コード例 #1
0
        public ItemPage()
        {
            InitializeComponent();

            // load preview & set item
            _item       = new TrinityItem();
            DataContext = _item;
            Loaded     += ItemPage_Loaded;
            _preview    = new ItemPreview(_item);
        }
コード例 #2
0
        private void newItemBtn_Click(object sender, RoutedEventArgs e)
        {
            var result = MessageBox.Show("Are you sure you want to discard this item and clear the form?",
                                         "Discard item", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                _item       = new TrinityItem();
                DataContext = null;
                DataContext = _item;
                PrepareItemPage();
            }
        }
コード例 #3
0
 public ItemPreview(TrinityItem item)
 {
     InitializeComponent();
     this._item  = item;
     DataContext = _item;
 }