private void ShowDetailsCommand_Executed(object parameter)
        {
            BinaryPart part = parameter as BinaryPart;

            TemplatePartDetailsWindowEventArgs detailsWindowEventArgs = new TemplatePartDetailsWindowEventArgs()
            {
                Part = part
            };

            TemplatePartDetailsWindowRequested?.Invoke(this, detailsWindowEventArgs);

            if (detailsWindowEventArgs.DialogResult)
            {
                part.Name = detailsWindowEventArgs.PartName;

                if (part is BinarySection section)
                {
                    section.LoopSettings.Type               = detailsWindowEventArgs.LoopSettings.Type;
                    section.LoopSettings.LoopCountFixed     = detailsWindowEventArgs.LoopSettings.LoopCountFixed;
                    section.LoopSettings.LoopCountReference = detailsWindowEventArgs.LoopSettings.LoopCountReference;
                }
                else if (part is BinaryValue value)
                {
                    value.ValueType = detailsWindowEventArgs.ValueType;
                }
            }
        }
예제 #2
0
        private void OnTemplatePartDetailsWindowRequested(object sender, TemplatePartDetailsWindowEventArgs e)
        {
            TemplatePartDetailsWindowView templatePartDetailsWindow = new TemplatePartDetailsWindowView(e);

            templatePartDetailsWindow.Owner = MainWindowView.MainWindowInstance;

            templatePartDetailsWindow.ShowDialog();
        }
예제 #3
0
        public TemplatePartDetailsWindowView(TemplatePartDetailsWindowEventArgs e)
        {
            InitializeComponent();

            ViewModel   = new TemplatePartDetailsWindowViewModel(e);
            DataContext = ViewModel;

            ViewModel.CloseRequested += OnCloseRequested;

            Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
        }