public CollectionEditor(WorkFrame frame, Type type) : base(frame) { if (type == null) { throw new ArgumentNullException("type"); } Type = type; CustomSetter = new EditorPropertySetter(Setter); Grid panel = new Grid(); panel.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(320, GridUnitType.Pixel) }); panel.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); panel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); panel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); List = new ListBox(); List.Height = 120; List.SelectionChanged += List_SelectionChanged; List.BorderThickness = new Thickness(1); Grid.SetRowSpan(List, 2); panel.Children.Add(List); Add = new Button(); Add.Height = 32; Add.Width = 64; Add.FontSize = 12; Add.Content = "添加"; Add.Click += Add_Click; Add.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; Grid.SetColumn(Add, 1); panel.Children.Add(Add); Remove = new Button(); Remove.Height = 32; Remove.Width = 64; Remove.FontSize = 12; Remove.Content = "删除"; Remove.IsEnabled = false; Remove.Click += Remove_Click; Remove.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; Grid.SetColumn(Remove, 1); Grid.SetRow(Remove, 1); panel.Children.Add(Remove); Content = panel; Frame.NavigationService.Navigated += NavigationService_Navigated; }
public PasswordEditor(WorkFrame frame) : base(frame) { CustomSetter = new EditorPropertySetter(SetPassword); password = new PasswordBox(); password.PasswordChanged += password_PasswordChanged; Content = password; }
public CollectionEditor(WorkFrame frame, Type type) : base(frame) { if (type == null) throw new ArgumentNullException("type"); Type = type; CustomSetter = new EditorPropertySetter(Setter); Grid panel = new Grid(); panel.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(320, GridUnitType.Pixel) }); panel.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); panel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); panel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); List = new ListBox(); List.Height = 120; List.SelectionChanged += List_SelectionChanged; List.BorderThickness = new Thickness(1); Grid.SetRowSpan(List, 2); panel.Children.Add(List); Add = new Button(); Add.Height = 32; Add.Width = 64; Add.FontSize = 12; Add.Content = "添加"; Add.Click += Add_Click; Add.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; Grid.SetColumn(Add, 1); panel.Children.Add(Add); Remove = new Button(); Remove.Height = 32; Remove.Width = 64; Remove.FontSize = 12; Remove.Content = "删除"; Remove.IsEnabled = false; Remove.Click += Remove_Click; Remove.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; Grid.SetColumn(Remove, 1); Grid.SetRow(Remove, 1); panel.Children.Add(Remove); Content = panel; Frame.NavigationService.Navigated += NavigationService_Navigated; }