Esempio n. 1
0
        private void OnTabSelectionChanged(object sender,
                                           SelectionChangedEventArgs e)
        {
            if (tcLayout.SelectedIndex == 1)
            {
                NewLayout.ValidateXaml();

                CtrlGroup.SetXamlLayout(NewLayout);
            }
        }
Esempio n. 2
0
        private void BtnOk_Click(object sender,
                                 RoutedEventArgs e)
        {
            if (NewLayout.Name != OriginalLayout.Name && LayoutManager.Instance.LayoutExists(NewLayout.Name))
            {
                Forge.Forms.Show.Window().For(new Alert($"'{NewLayout.Name}' is already in use"));
                return;
            }

            NewLayout.ValidateXaml();

            if (NewLayout.IsValid == false)
            {
                var dialog = Forge.Forms.Show
                             .Window()
                             .For(new Confirmation("Invalid XAML markup. Save changes anyway ?", "Warning"));

                if (dialog.Result.Model.Confirmed == false)
                {
                    return;
                }
            }

            OriginalLayout.CopyFrom(NewLayout);

            if (IsDefault)
            {
                LayoutManager.Instance.SetDefault(OriginalLayout.Name);
            }

            else if (OriginalLayout.IsDefault)
            {
                LayoutManager.Instance.SetDefault(LayoutManager.GenericLayoutName);
            }

            DialogResult = true;
            Close();
        }
Esempio n. 3
0
        private void onClickMyNew(object sender, RoutedEventArgs e)
        {
            NewLayout layout = new NewLayout();

            layout.Show();
        }