摘要:<Grid Background="White"> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition Height="A
阅读全文
摘要:<Window x:Class="PrismWpfBlankApp.Views.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsof
阅读全文
摘要:<StackPanel> <Button Command="{Binding OpenCommand}" Content="事件" /> <Button Command="{Binding PublishCommand}" Content="发布消息"/> <Button Command="{Bin
阅读全文
摘要:Region 的作用:在指定区域展示用户控件,是模块化的核心功能,其主要目的是弱化模块与模块之间的耦合关系。 一、定义XML区域: 1.1 使用XML设置区域名称 <ContentControl prism:RegionManager.RegionName="ContentRegion" /> 1.
阅读全文
摘要:<TextBox Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Width="250" md:HintAssist.Hint="查找待办事项"
阅读全文
摘要:引用命名空间: xmlns:i="http://schemas.microsoft.com/xaml/behaviors" 通过行为类,可以为控件添加触发器 <ScrollViewer Grid.Row="1"> <ItemsControl ItemsSource="{Binding ToDoDto
阅读全文
摘要:1. 用 nuget 添加引用:MaterialDesignThemes 2. 编辑 App.xaml <Application . . . xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"> <Appl
阅读全文
摘要:private void shopPicButton_Click(object sender, RoutedEventArgs e) {//选择图片并加载显示 OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.F
阅读全文
摘要:主题外观包:MaterialDesignThemes MVVM 模式:Prism.DryIoc
阅读全文
摘要:using System.Windows.Media.Animation; <Grid> <StackPanel> <Button x:Name="btn" Content="执行动画" Width="100" Height="40" Click="Button_Click"/> </StackPa
阅读全文
摘要:1.在项目上点右键,添加 ”资源字典WPF“ ,命名为:ButtonStyle.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sch
阅读全文
摘要:public class ViewModel : ObservableObject { public ViewModel() { ShowCommand = new RelayCommand<string>(Show); } private string name; public string Na
阅读全文
摘要:<Grid> <ListBox x:Name="list"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border Width="10" Height="10" Background="
阅读全文
摘要:<Window.Resources> <Style x:Key="BaseButtonStyle" TargetType="Button"> <Setter Property="FontSize" Value="15"/> </Style> <Style x:Key="myStyle" Target
阅读全文
摘要:引用程序包:MvvmLight 实体类: public class Student : ViewModelBase { private int id; private string name; public int Id { get { return id; } set { id = value;
阅读全文
摘要:元素绑定 <StackPanel> <Slider x:Name="slider1" Width="200" ></Slider> <TextBox Name="txt" Text="{Binding ElementName=slider1,Path=Value,UpdateSourceTrigge
阅读全文