private void buttonSave_Click(object sender, RoutedEventArgs e) { if (selectedTile == TileSelections.Save) { // Activate default action ActionSave(); } else { selectedTile = TileSelections.Save; listBoxOptions.Items.Clear(); listBoxOptions.Visibility = Visibility.Visible; listBoxOptions.Items.Add(GetNewOptionsItem("Save current", ActionSave)); listBoxOptions.SelectedIndex = 0; labelSelectedTile.Content = "Save"; labelSelectedTile.Visibility = Visibility.Visible; Image image = new Image(); image.SetBitmapSource("/Metro%20Tables;component/Images/SaveWork.png"); ShowTopControl(image); } }
private void buttonOpen_Click(object sender, RoutedEventArgs e) { if (selectedTile == TileSelections.Open) { // Activate default action ActionOpenFromFile(); } else { selectedTile = TileSelections.Open; listBoxOptions.Items.Clear(); listBoxOptions.Visibility = System.Windows.Visibility.Visible; listBoxOptions.Items.Add(GetNewOptionsItem("From file...", ActionOpenFromFile)); listBoxOptions.Items.Add(GetNewOptionsItem("From URL...", ActionOpenFromURL)); listBoxOptions.Items.Add(GetNewOptionsItem("Recent", ActionOpenFromRecent)); listBoxOptions.SelectedIndex = 0; labelSelectedTile.Content = "Open worksheet"; labelSelectedTile.Visibility = System.Windows.Visibility.Visible; Image image = new Image(); image.SetBitmapSource("/Metro%20Tables;component/Images/OpenXLSX.png"); ShowTopControl(image); } }