本示例创建了一个简单的UI,一个带有按钮的MainMenuControl,单击按钮会调用ShowTextCommand(定义在POCO View Model).
语言:C# 支持版本:v2015.1.3-v2015.2.7
<Window x:Class="WpfApplication25.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" xmlns:local="clr-namespace:WpfApplication25" dx:ThemeManager.ThemeName="Office2013" DataContext="{dxmvvm:ViewModelSource Type={x:Type local:ViewModel}}" Title="MainWindow" Height="350" Width="525"> <dxmvvm:Interaction.Behaviors> <dx:DXMessageBoxService/> </dxmvvm:Interaction.Behaviors> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <dxb:MainMenuControl BarItemDisplayMode="ContentAndGlyph"> <dxb:BarButtonItem Content="Show Text" Command="{Binding ShowTextCommand}" Glyph="{dx:DXImage Image=News_16x16.png}" LargeGlyph="{dx:DXImage Image=News_32x32.png}" /> </dxb:MainMenuControl> <dxe:TextEdit EditValue="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" NullText="Type your text here" Grid.Row="1"/> </Grid> </Window>
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/631.html
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/631.html