Exemplo n.º 1
0
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            var button    = sender as ButtonWithObject;
            var parameter = button?.Object;

            switch (parameter)
            {
            case Operation operation:
            {
                var view = new ManuallyOperationsView(operation);
                ViewManager.AddUserControl(view);
                ViewManager.OpenUserControl(view);
                break;
            }

            case OperationsGroup group:
            {
                var view = new AddGroupsView(group);
                ViewManager.AddUserControl(view);
                ViewManager.OpenUserControl(view);
                break;
            }
            }

            e.Handled = true;
        }
Exemplo n.º 2
0
        private void _btnGroup_Click(object sender, RoutedEventArgs e)
        {
            var uc = new AddGroupsView();

            ViewManager.AddUserControl(uc);
            ViewManager.OpenUserControl(uc);
        }
Exemplo n.º 3
0
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            var button    = sender as ButtonWithObject;
            var parameter = button?.Object;

            switch (parameter)
            {
            case Operation operation:
            {
                var view = new ManuallyOperationsView(operation);
                ViewManager.AddUserControl(view);
                ViewManager.OpenUserControl(view);
                break;
            }

            case OperationsGroup group:
            {
                var view = new AddGroupsView(group);
                ViewManager.AddUserControl(view);
                ViewManager.OpenUserControl(view);
                break;
            }

            case Group _:
            {
                if (button.Context is StackPanel stackPanel)
                {
                    stackPanel.Children[0].Visibility = stackPanel.Children[0].Visibility == Visibility.Visible
                            ? Visibility.Collapsed
                            : Visibility.Visible;
                }

                break;
            }
            }

            e.Handled = true;
        }