private void SubmitButtonClicked(object sender, RoutedEventArgs e) { sp = new Shared.ScientificProduction(TypeBox.Text, TitleBox.Text, ContentBox.Text); var mainWindow = (Application.Current.MainWindow as MainWindow); try { string result = mainWindow.PublishingObject.PublishScientificProductionAndNotify(this.sp, mainWindow.User.Profile); if (result == "done") { Productions productions = (((mainWindow.MainFrame as Frame).Content as Pages.Dash).ProfileFrame.Content as Pages.Profile).productions; productions.CreateAndPlaceProductionCard(this.sp); Frame productionsFrame = (((mainWindow.MainFrame as Frame).Content as Pages.Dash).ProfileFrame.Content as Pages.Profile).ProductionsFrame; ReturnBackIfAvailable(productionsFrame); } else { MessageBox.Show(result); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public ProductionCard(Shared.ScientificProduction sp) { InitializeComponent(); Type.Content = sp.Type; Title.Content = sp.Title; }
public void CreateAndPlaceProductionCard(Shared.ScientificProduction sp) { ProductionCard productionCard = new Assets.ProductionCard(sp); TransformToColumnAndRow(); this.Grid.Children.Add(productionCard); Grid.SetColumn(productionCard, CurrentColumn); Grid.SetRow(productionCard, CurrentRow); }