예제 #1
0
        private void SelectFlag(JryFlagType type)
        {
            var flags = this.ViewModel[type];

            var dlg = new FlagSelectorWindow(type, flags)
            {
                Owner = this.TryFindParent <Window>()
            };

            if (dlg.ShowDialog() == true)
            {
                flags.Clear();
                flags.AddRange(dlg.ViewModel.SelectedItems.Select(z => z.Source.Value));
            }
        }
예제 #2
0
        private void SelectButton_OnClick(object sender, RoutedEventArgs e)
        {
            var dc = this.DataContext as SelectFlagViewModel;

            Debug.Assert(dc != null);
            var dlg = new FlagSelectorWindow(dc.Type, dc.Collection)
            {
                Owner = this.TryFindParent <Window>()
            };

            if (dlg.ShowDialog() == true)
            {
                dc.Collection.Clear();
                dc.Collection.AddRange(dlg.ViewModel.SelectedItems.Select(z => z.Source.Value));
            }
        }