public EditableProgramItemControl(ProgramItemBase programItem) { ProgramItem = programItem; DataContext = ProgramItem; InitializeComponent(); if (ProgramItem is SteamProgramItem) { ProgramLocationGrid.Visibility = Visibility.Collapsed; } }
private void SaveProgramItem(object sender, EventArgs e) { ProgramItemBase update = (sender as EditableProgramItemControl).ProgramItem; ProgramItem.ProgramName = update.ProgramName; ProgramItem.ImageLocation = update.ImageLocation; if (update is ProgramItem) { (ProgramItem as ProgramItem).ProgramLocation = (update as ProgramItem).ProgramLocation; } CloseEditGrid(); }