public ItemPage() { InitializeComponent(); // load preview & set item _item = new TrinityItem(); DataContext = _item; Loaded += ItemPage_Loaded; _preview = new ItemPreview(_item); }
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(); } }
public ItemPreview(TrinityItem item) { InitializeComponent(); this._item = item; DataContext = _item; }