Ejemplo n.º 1
0
        //=============================================================================
        private async void SheetTextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                DrawingSheet _sheet = null;
                TextBlock    tb     = sender as TextBlock;
                if (tb != null)
                {
                    _sheet = tb.DataContext as DrawingSheet;
                }

                if (_sheet != null && _sheet.Document != null)
                {
                    SheetNameDialog_ViewModel vm = new SheetNameDialog_ViewModel(_sheet);
                    vm.Name = _sheet.Name;

                    SheetName_Dialog _SheetNameDialog = new SheetName_Dialog(vm);

                    // true - OK
                    // false - CANCEL
                    var result = await DialogHost.Show(_SheetNameDialog);

                    if (result is bool && (bool)result)
                    {
                        _sheet.Name = vm.Name;
                        _sheet.MarkStateChanged();
                    }
                }

                e.Handled = true;
            }
        }
Ejemplo n.º 2
0
        public SheetName_Dialog(SheetNameDialog_ViewModel vm)
        {
            InitializeComponent();

            m_VM        = vm;
            DataContext = m_VM;

            if (CurrentTheme.CurrentColorTheme != null)
            {
                CurrentTheme.CurrentColorTheme.ApplyTheme(this.Resources);
            }
        }