private void initiateCommandBar() { CommandBar bar = new CommandBar(); AppBarButton logou = new AppBarButton() { Icon = new SymbolIcon(Symbol.Cancel), Label = "Log out" }; logou.Click += logout; AppBarButton refr = new AppBarButton() { Icon = new BitmapIcon() { UriSource = new Uri("ms-appx:Assets/Buttons/appbar.refresh.png") }, Label = "Refresh" }; refr.Click += refresh; AppBarButton search = new AppBarButton() { Icon = new SymbolIcon(Symbol.Find), Label = "Search" }; search.Click += search_Click; AppBarButton ideas = new AppBarButton() { Label = "Suggest a feature" }; ideas.Click += openForum; AppBarButton bugs = new AppBarButton() { Label = "Report a bug" }; ideas.Click += openForum; AppBarButton contact = new AppBarButton() { Label = "Contact Developer" }; contact.Click += sendEmail; bar.PrimaryCommands.Add(refr); bar.PrimaryCommands.Add(search); bar.PrimaryCommands.Add(logou); bar.SecondaryCommands.Add(ideas); bar.SecondaryCommands.Add(bugs); bar.SecondaryCommands.Add(contact); bar.ClosedDisplayMode = AppBarClosedDisplayMode.Minimal; BottomAppBar = bar; }
public static void AddBottomAppBar(Page myPage) { var commandBar = new CommandBar(); var searchButton = new AppBarButton { Label = "Поиск", Icon = new SymbolIcon(Symbol.Find), }; var aboutButton = new AppBarButton { Label = "О прилож.", Icon = new SymbolIcon(Symbol.Help), }; if (RootFrame != null) { searchButton.Click += SearchButtonClick; aboutButton.Click += AboutButtonClick; } commandBar.PrimaryCommands.Add(searchButton); commandBar.PrimaryCommands.Add(aboutButton); myPage.BottomAppBar = commandBar; }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { string message = (string)e.Parameter; if(message=="edit") { editTxt.Text = message; //Adding "delete" AppBarbutton AppBarButton buttonToAdd = new AppBarButton { Label = "delete", Icon = new SymbolIcon(Symbol.Delete) }; (BottomAppBar as CommandBar).PrimaryCommands.Add(buttonToAdd); //TODO: create event on click or bind it to a command //buttonToAdd.Click += async (sender, e) => await new MessageDialog("Button clicked").ShowAsync(); //Binding myBind = new Binding(); //myBind.Path = new PropertyPath("GoToAddSampleItemssPageCommand"); //myBind.Source = DataContext; //buttonToAdd.SetBinding(AppBarButton.CommandProperty, myBind); } else { editTxt.Text = "new"; } }
public static CommandBar ToAppCommandBar(this IContextMenu source, CommandBar menu, bool isSecondary) { var commandsVector = isSecondary ? menu.SecondaryCommands : menu.PrimaryCommands; commandsVector.Clear(); foreach(var item in source.Items) { AppBarButton button = new AppBarButton(); commandsVector.Add(button); button.Label = item.Header; button.Command = item.Command; button.CommandParameter = item.CommandParameter; if (!string.IsNullOrEmpty(item.Icon)) { var icon = new SymbolIcon(); icon.Symbol = (Symbol)System.Enum.Parse(typeof(Symbol), item.Icon); button.Icon = icon; } else button.Icon = new SymbolIcon(Symbol.Emoji); } return menu; }
protected override void OnNavigatedTo(NavigationEventArgs e) { // Create the AppBarButton for the 'Triangle' command AppBarButton triangle = new AppBarButton(); triangle.Label = "Triangle"; // This button will use the PathIcon class for its icon which allows us to // use vector data to represent the icon PathIcon trianglePathIcon = new PathIcon(); PathGeometry g = new PathGeometry(); g.FillRule = FillRule.Nonzero; // Just create a simple triange shape PathFigure f = new PathFigure(); f.IsFilled = true; f.IsClosed = true; f.StartPoint = new Windows.Foundation.Point(20.0, 5.0); LineSegment s1 = new LineSegment(); s1.Point = new Windows.Foundation.Point(30.0, 30.0); LineSegment s2 = new LineSegment(); s2.Point = new Windows.Foundation.Point(10.0, 30.0); LineSegment s3 = new LineSegment(); s3.Point = new Windows.Foundation.Point(20.0, 5.0); f.Segments.Add(s1); f.Segments.Add(s2); f.Segments.Add(s3); g.Figures.Add(f); trianglePathIcon.Data = g; triangle.Icon = trianglePathIcon; ((CommandBar)BottomAppBar).PrimaryCommands.Insert(2, triangle); }
public PlaybackControl(Grid grid) { PlaybackControlGrid = grid; PlayPauseButton = PlaybackControlGrid.FindName("PlayPauseButtonOnLeft") as AppBarButton; ShuffleButton = PlaybackControlGrid.FindName("ShuffleButton") as AppBarButton; AlbumArtwork = PlaybackControlGrid.FindName("PlayBackImage") as Image; TimeRemainingBlock = PlaybackControlGrid.FindName("TimeRemainingBlock") as TextBlock; TimePastBlock = PlaybackControlGrid.FindName("TimeElapsedBlock") as TextBlock; ProgressSlider = PlaybackControlGrid.FindName("ProgressSlider") as Slider; }
private void AdicionaOpcaoAppBar(object sender, RoutedEventArgs e) { bottomAppBar.PrimaryCommands.Insert(0, new AppBarSeparator()); AppBarButton addButton = new AppBarButton(); addButton.Icon = new SymbolIcon(Symbol.Add); addButton.Label = "Add"; addButton.Click += AdicionaOpcaoAppBar; bottomAppBar.PrimaryCommands.Insert(0, addButton); }
public About() { this.InitializeComponent(); DisplayName.Text = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("DisplayName"); Description.Text = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Description"); #if WINDOWS_APP AppBarButton BackButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Back/Label") }; BackButton.Click += Back_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(BackButton); #endif }
public Settings() { this.DataContext = this; MyAppSettings = new AppSettings(); this.InitializeComponent(); #if WINDOWS_APP AppBarButton BackButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Back/Label") }; BackButton.Click += Back_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(BackButton); #endif }
protected override void OnNavigatedTo(NavigationEventArgs e) { navParam = e.Parameter as CodeEditorContext; if (navParam.tableName != "Problems") { CommandBar bottomCommandBar = this.BottomAppBar as CommandBar; AppBarButton b = bottomCommandBar.PrimaryCommands[0] as AppBarButton; //b.Click -= Solution; bottomCommandBar.PrimaryCommands.RemoveAt(0); } createHtmlFileInLocalState(); this.navigationHelper.OnNavigatedTo(e); }
private async void Contact_Click(object sender, RoutedEventArgs e) { AppBarButton appBarButton = (AppBarButton)sender; int tag = Convert.ToInt32(appBarButton.Tag); if (sourcePage == 1) { UserFollow userFollow = new UserFollow { Userid = HomePage.Current.myStruct.id, FollowUserid = tag, }; await DeleteFollow(userFollow, appBarButton); } }
public VolumeFlyout(Slider volumeSlider, Button muteButton, AppBarButton volumeButton, MediaElement streamPlayer) { muteVolume = 100; isMuted = false; wasJustMuted = false; VolumeButton = volumeButton; VolumeSlider = volumeSlider; MuteButton = muteButton; StreamPlayer = streamPlayer; volumeSlider.ValueChanged += VolumeSlider_ValueChanged; muteButton.Click += MuteButton_Click; }
private void InitAppBar() { StringResources stx = StringResources.Load("ContextMenu"); AppBarButton ImportSpider = UIAliases.CreateAppBarBtn(SegoeMDL2.OpenFile, stx.Text("ImportSpider")); ImportSpider.Click += OpenSpider; SecondaryIconButton SpiderEditor = UIAliases.CreateSecondaryIconBtn(SegoeMDL2.Edit, stx.Text("SpiderEdit", "ContextMenu")); SpiderEditor.Click += (s, e) => ControlFrame.Instance.NavigateTo(PageId.PROC_PANEL, () => new ProcPanelWrapper(null)); MajorControls = new ICommandBarElement[] { ImportSpider }; Major2ndControls = new ICommandBarElement[] { SpiderEditor }; }
private static void ActionsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var control = d as ActionsCommandBar; if (control != null) { foreach (var action in control.ActionsSource) { var label = GetText(action, ActionTextProperties.Label); var automationPropertiesName = GetText(action, ActionTextProperties.AutomationPropertiesName); var button = FindButton(label, control); if (button == null) { button = new AppBarButton(); if (action.ActionType == ActionType.Primary) { control.PrimaryCommands.Add(button); } else if (action.ActionType == ActionType.Secondary) { control.SecondaryCommands.Add(button); } } button.Command = action.Command; button.CommandParameter = action.CommandParameter; button.Label = label; AutomationProperties.SetName(button, automationPropertiesName); if (!string.IsNullOrEmpty(label)) { ToolTipService.SetToolTip(button, GetTooltip(label)); ToolTipService.SetPlacement(button, PlacementMode.Mouse); } if (Application.Current.Resources.ContainsKey(action.Style)) { button.Style = Application.Current.Resources[action.Style] as Style; } if (button.Command?.CanExecute(button?.CommandParameter) == true) { button.Visibility = Visibility.Visible; } else { button.Visibility = Visibility.Collapsed; } } } }
private static void ActionsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var control = d as ActionsCommandBar; if (control != null) { foreach (var action in control.ActionsSource) { var label = GetText(action, ActionTextProperties.Label); var automationPropertiesName = GetText(action, ActionTextProperties.AutomationPropertiesName); var button = FindButton(label, control); if (button == null) { button = new AppBarButton(); if (action.ActionType == ActionType.Primary) { control.PrimaryCommands.Add(button); } else if (action.ActionType == ActionType.Secondary) { control.SecondaryCommands.Add(button); } } button.Command = action.Command; button.CommandParameter = action.CommandParameter; button.Label = label; AutomationProperties.SetName(button, automationPropertiesName); if (!string.IsNullOrEmpty(label)) { ToolTipService.SetToolTip(button, GetTooltip(label)); ToolTipService.SetPlacement(button, PlacementMode.Mouse); } if (Application.Current.Resources.ContainsKey(action.Style)) { button.Style = Application.Current.Resources[action.Style] as Style; } if (button.Command?.CanExecute(button?.CommandParameter) == true) { button.Visibility = Visibility.Visible; } else { button.Visibility = Visibility.Collapsed; } } } }
private async Task DelPutlike(int Articalid, int Myid, AppBarButton appBarButton) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Clear(); httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); var content = new StringContent("", Encoding.UTF8, "application/json"); HttpResponseMessage httpResponseMessage = await httpClient.PutAsync($"http://localhost:60671/api/artical/delputlike/{Articalid}/{Myid}", content); var res = await httpResponseMessage.Content.ReadAsAsync <bool>(); if (res == true) { Modifyinfor(0, appBarButton); } }
/// <summary> /// Rename the current Notebook /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void RenameNotebookClickAsync(object sender, Windows.UI.Xaml.RoutedEventArgs e) { AppBarButton button = (AppBarButton)sender; BangumiNotebook notebook = (BangumiNotebook)button.DataContext; // Show input dialog to get the new Notebook name var dialog = new InputDialog("Rename Nootbook", notebook.Title); var result = await dialog.ShowAsync(); if (result != ContentDialogResult.Primary) { return; } notebook.Title = dialog.Text; }
private void UnsetMultipleSelection() { ListView list = listViews[this.pivot.SelectedIndex]; list.SelectionMode = ListViewSelectionMode.None; list.IsItemClickEnabled = true; if (CommandBar != null) { AppBarButton b = CommandBar.PrimaryCommands[DELETE_APP_BAR_BUTTON_POSITION] as AppBarButton; b.Click -= DeleteAppBarButton_Click; // Remove AppBarButton. CommandBar.PrimaryCommands.RemoveAt(DELETE_APP_BAR_BUTTON_POSITION); // Remove AppBarSeparator. CommandBar.PrimaryCommands.RemoveAt(DELETE_APP_BAR_BUTTON_POSITION); } }
public EventPage() { Other.Other.Transition(this); this.InitializeComponent(); if (Other.Other.IsMobile()) { Grid.SetRow(CB, 2); CB.Padding = new Thickness(0, 0, 0, 0); CBMobile.Visibility = Visibility.Visible; CBTitle.Visibility = Visibility.Collapsed; CB.Background = new SolidColorBrush(Color.FromArgb(255, 27, 27, 27)); } rsvpButton = CBRSVP; }
private void Send_Click(object sender, RoutedEventArgs e) { AppBarButton appBarButton = (AppBarButton)sender; var list = NameMap.FindParent <ListViewItem>(appBarButton); if (RootPivot.SelectedIndex == 0) { viewItem = list; Frame.Navigate(typeof(EditArtical), drafts[Draftlist.IndexFromContainer(list)]); } else if (RootPivot.SelectedIndex == 1) { vAnsItem = list; Frame.Navigate(typeof(MakeAnswer), answerDrafts[AnswerList.IndexFromContainer(list)]); } }
private async void LikeButton_Click(object sender, RoutedEventArgs e) { AppBarButton appBarButton = (AppBarButton)sender; int Answerid = Convert.ToInt32(appBarButton.Tag); int Myid = (HomePage.Current.myStruct.id); var fore = appBarButton.Foreground as SolidColorBrush; if (fore.Color == Colors.Black) { await PutLike(Answerid, Myid, Qusitionid); } else { await DelPutLike(Answerid, Myid, Qusitionid); } }
public AppBar GetBottomAppBar() { var appBar = new CommandBar(); var saveButton = new AppBarButton() { Label = "Сохранить", Icon = new SymbolIcon(Symbol.Accept) }; saveButton.Click += SaveButtonOnClick; appBar.PrimaryCommands.Add(saveButton); return appBar; }
/// <summary> /// Получить нижнюю строку команд. /// </summary> /// <returns>Строка команд.</returns> public AppBar GetBottomAppBar() { var appBar = new CommandBar(); var syncButton = new AppBarButton() { Label = "Обновить", Icon = new SymbolIcon(Symbol.Sync) }; syncButton.Click += SyncButtonOnClick; appBar.PrimaryCommands.Add(syncButton); return appBar; }
public async void OnXamlRendered(FrameworkElement control) { dataGrid = control.FindDescendantByName("dataGrid") as DataGrid; if (dataGrid != null) { dataGrid.ItemsSource = await viewModel.GetDataAsync(); dataGrid.Sorting += DataGrid_Sorting; dataGrid.LoadingRowGroup += DataGrid_LoadingRowGroup; var comboBoxColumn = dataGrid.Columns.FirstOrDefault(x => x.Tag.Equals("Mountain")) as DataGridComboBoxColumn; if (comboBoxColumn != null) { comboBoxColumn.ItemsSource = await viewModel.GetMountains(); } } groupButton = control.FindDescendantByName("groupButton") as AppBarButton; if (groupButton != null) { groupButton.Click += GroupButton_Click; } rankLowItem = control.FindName("rankLow") as MenuFlyoutItem; if (rankLowItem != null) { rankLowItem.Click += RankLowItem_Click; } rankHighItem = control.FindName("rankHigh") as MenuFlyoutItem; if (rankHighItem != null) { rankHighItem.Click += RankHigh_Click; } heightLowItem = control.FindName("heightLow") as MenuFlyoutItem; if (heightLowItem != null) { heightLowItem.Click += HeightLow_Click; } heightHighItem = control.FindName("heightHigh") as MenuFlyoutItem; if (heightHighItem != null) { heightHighItem.Click += HeightHigh_Click; } }
static void CreateBar() { if (menu.bk != null) { BarResize(); ShowBar(); return; } current = 0; menu.bk = new Border(); menu.bk.Background = bk_brush; AppBarButton si = new AppBarButton(); si.Icon = new SymbolIcon(Symbol.Home); si.Click += (o, e) => { ChangeCurrent(0); }; si.Foreground = filter_brush; si.Width = 36; si.Height = 36; menu.home = si; si = new AppBarButton(); si.Icon = new SymbolIcon(Symbol.Setting); si.Click += (o, e) => { ChangeCurrent(1); }; si.Foreground = filter_brush; si.Width = 36; si.Height = 36; menu.buff = si; si = new AppBarButton(); si.Icon = new SymbolIcon(Symbol.Comment); si.Click += (o, e) => { ChangeCurrent(2); }; si.Foreground = filter_brush; si.Width = 36; si.Height = 36; menu.setting = si; si = new AppBarButton(); si.Icon = new SymbolIcon(Symbol.Download); si.Click += (o, e) => { ChangeCurrent(3); }; si.Foreground = filter_brush; si.Width = 36; si.Height = 36; menu.about = si; parent.Children.Add(menu.bk); parent.Children.Add(menu.home); parent.Children.Add(menu.buff); parent.Children.Add(menu.setting); parent.Children.Add(menu.about); BarResize(); }
private void AddSecondaryCommands_Click(object sender, RoutedEventArgs e) { // Add compact button to the command bar. It provides functionality specific // to this page, and is removed when leaving the page. if (PrimaryCommandBar.SecondaryCommands.Count == 1) { var newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.Add); newButton.Label = "Button 1"; newButton.KeyboardAccelerators.Add(new Windows.UI.Xaml.Input.KeyboardAccelerator() { Key = Windows.System.VirtualKey.N, Modifiers = Windows.System.VirtualKeyModifiers.Control }); PrimaryCommandBar.SecondaryCommands.Add(newButton); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.Delete); newButton.Label = "Button 2"; PrimaryCommandBar.SecondaryCommands.Add(newButton); newButton.KeyboardAccelerators.Add(new Windows.UI.Xaml.Input.KeyboardAccelerator() { Key = Windows.System.VirtualKey.Delete }); PrimaryCommandBar.SecondaryCommands.Add(new AppBarSeparator()); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.FontDecrease); newButton.Label = "Button 3"; newButton.KeyboardAccelerators.Add(new Windows.UI.Xaml.Input.KeyboardAccelerator() { Key = Windows.System.VirtualKey.Subtract, Modifiers = Windows.System.VirtualKeyModifiers.Control }); PrimaryCommandBar.SecondaryCommands.Add(newButton); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.FontIncrease); newButton.Label = "Button 4"; newButton.KeyboardAccelerators.Add(new Windows.UI.Xaml.Input.KeyboardAccelerator() { Key = Windows.System.VirtualKey.Add, Modifiers = Windows.System.VirtualKeyModifiers.Control }); PrimaryCommandBar.SecondaryCommands.Add(newButton); } }
// 页面跳转 private void goToOtherPage(object sender, RoutedEventArgs e) { AppBarButton btn = sender as AppBarButton; if (btn.Name == "main") { (Window.Current.Content as Frame).Navigate(typeof(MainPage)); } else if (btn.Name == "user") { (Window.Current.Content as Frame).Navigate(typeof(UserPage)); } else if (btn.Name == "edit") { (Window.Current.Content as Frame).Navigate(typeof(EditPage)); } }
private void OnConnectionEstablished() { AppBarButton connectBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "ConnectDevice") as AppBarButton; connectBtn.Visibility = Visibility.Collapsed; AppBarButton refreshBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "RefreshDeviceList") as AppBarButton; refreshBtn.Visibility = Visibility.Collapsed; AppBarButton disconnectBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "DisconnectDevice") as AppBarButton; disconnectBtn.Visibility = Visibility.Visible; AppBarSeparator seperator1 = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarSeparator && ((AppBarSeparator)i).Name == "sperator1") as AppBarSeparator; seperator1.Visibility = Visibility.Collapsed; AppBarSeparator seperator2 = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarSeparator && ((AppBarSeparator)i).Name == "sperator2") as AppBarSeparator; seperator2.Visibility = Visibility.Visible; AppBarToggleButton headlights = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarToggleButton && ((AppBarToggleButton)i).Name == "Headlights") as AppBarToggleButton; headlights.Visibility = Visibility.Visible; if (App.AppData.ConnectedAucovei.IsNewGeneration) { AppBarToggleButton camera = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarToggleButton && ((AppBarToggleButton)i).Name == "Camera") as AppBarToggleButton; camera.Visibility = Visibility.Visible; } //AppBarButton deleteroute = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "DeleteRoute") as AppBarButton; //deleteroute.Visibility = Visibility.Visible; AppBarButton hornBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "Horn") as AppBarButton; hornBtn.Visibility = Visibility.Visible; this.rootPage.NotifyUser("Connected to " + App.AppData.ConnectedAucovei.DisplayName + "!", NotifyType.StatusMessage); this.rootPage.UpdateNavigation(1); this.Frame.Navigate(typeof(AddWaypoints)); }
public ExtSplashScreen() { this.InitializeComponent(); //this.BottomAppBar.Visibility = Windows.UI.Xaml.Visibility.Visible; //this.ProgressGrid.Visibility = Windows.UI.Xaml.Visibility.Collapsed; Position(); //LayoutUpdated += SplashScreen_LayoutUpdated; #if WINDOWS_APP AppBarButton BackButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Back/Label") }; BackButton.Click += Back_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(BackButton); #endif System.Threading.Tasks.Task t = DismissExtendedSplash(); }
public override void HandleMove(object arg) { if (arg is ScaleTransform) { var toScaleValue = (ScaleTransform)arg; bool isScaleAllowed = checkIfScalingAllowed(toScaleValue); if (isScaleAllowed) { var fixedaspection = 0.0; fixedaspection = toScaleValue.ScaleX > toScaleValue.ScaleY ? toScaleValue.ScaleX : toScaleValue.ScaleY; toScaleValue.ScaleX = fixedaspection; toScaleValue.ScaleY = fixedaspection; if (PocketPaintApplication.GetInstance().isZoomButtonClicked) { toScaleValue.CenterX = DISPLAY_WIDTH_HALF; toScaleValue.CenterY = DISPLAY_HEIGHT_HALF; } else { toScaleValue.CenterX = startScale.X; toScaleValue.CenterY = startScale.Y; } _transforms.Children.Add(toScaleValue); _tempTransforms.Children.Add(toScaleValue); } } else if (arg is TranslateTransform) { var move = (TranslateTransform)arg; _transforms.Children.Add(move); _tempTransforms.Children.Add(move); } else { System.Diagnostics.Debug.WriteLine("MoveZoomTool Should Not Reach this!"); return; } AppBarButton appBarButtonReset = PocketPaintApplication.GetInstance().PaintingAreaView.getAppBarResetButton(); if (appBarButtonReset != null) { appBarButtonReset.IsEnabled = true; } }
private async void Call(object sender, RoutedEventArgs e) { AppBarButton ell = sender as AppBarButton; int i = Convert.ToInt16(ell.Tag.ToString()); switch (i) { case 1: Action_Fb("bits.atmos"); break; case 2: await Launcher.LaunchUriAsync(new Uri("https://twitter.com/BITSAtmos")); break; case 3: await Launcher.LaunchUriAsync(new Uri("mailto:[email protected]")); break; case 4: await Launcher.LaunchUriAsync(new Uri("http://www.bits-atmos.org")); break; case 11: Action_Call("Nikhil Potluri (President)", "+919542554003"); break; case 21: Action_Call("Vishnu Saran (General Secretary)", "+9199848294152"); break; case 31: Action_Call("Suhrudh Reddy (Publicity)", "+918498964792"); break; case 41: Action_Call("Srikar (Sponsorship)", "+919573190492"); break; case 51: Action_Call("Mudit Jain (Technical Convener)", "+918498085518"); break; case 12: Action_Message("Nikhil Potluri (President)", "+919542554003"); break; case 22: Action_Message("Vishnu Saran (General Secretary)", "+9199848294152"); break; case 32: Action_Message("Suhrudh Reddy (Publicity)", "+918498964792"); break; case 42: Action_Message("Srikar (Sponsorship)", "+919573190492"); break; case 52: Action_Message("Mudit Jain (Technical Convener)", "+918498085518"); break; case 13: Action_Fb("nikhilpotluri"); break; case 23: Action_Fb("vishnusaranwriting"); break; case 33: Action_Fb("suhrudh.reddy.39"); break; case 43: Action_Fb("srikar.mokkapati"); break; case 53: Action_Fb("Mudit1729"); break; } }
public FeedPage() { this.InitializeComponent(); this.SetValue(NavProperties.HeaderProperty, ResourceLoader.GetForCurrentView().GetString("Feeds")); var headerButtons = new ObservableCollection <object>(); var refreshButton = new AppBarButton { Label = ResourceLoader.GetForCurrentView().GetString("Refresh"), Icon = new SymbolIcon { Symbol = (Symbol)Enum.Parse(typeof(Symbol), "Refresh") }, Command = ViewModel.RefreshButtonCommand }; headerButtons.Add(refreshButton); SetValue(NavProperties.HeaderCommandsProperty, headerButtons); }
public async Task <bool> AddAsync(AppBarButton button, ResourceDictionary resources) { Appointment appointment = await Dialog(new Appointment(), resources); if (appointment != null) { AppointmentCalendar calendar = await GetAsync(); if (calendar != null) { await calendar.SaveAppointmentAsync(appointment); return(true); } } return(false); }
private void DisconnectBtn_Click(object sender, RoutedEventArgs e) { this.ResetAppLevelParameters(); this.rootPage.UpdateNavigation(0); AppBarButton refreshBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "RefreshDeviceList") as AppBarButton; refreshBtn.Visibility = Visibility.Visible; AppBarButton disconnectBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "DisconnectDevice") as AppBarButton; disconnectBtn.Visibility = Visibility.Collapsed; AppBarSeparator seperator = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarSeparator && ((AppBarSeparator)i).Name == "sperator1") as AppBarSeparator; seperator.Visibility = Visibility.Collapsed; AppBarButton connectBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "ConnectDevice") as AppBarButton; connectBtn.Visibility = Visibility.Visible; AppBarSeparator seperator1 = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarSeparator && ((AppBarSeparator)i).Name == "sperator1") as AppBarSeparator; seperator1.Visibility = Visibility.Collapsed; AppBarSeparator seperator2 = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarSeparator && ((AppBarSeparator)i).Name == "sperator2") as AppBarSeparator; seperator2.Visibility = Visibility.Collapsed; AppBarToggleButton headlights = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarToggleButton && ((AppBarToggleButton)i).Name == "Headlights") as AppBarToggleButton; headlights.Visibility = Visibility.Collapsed; AppBarToggleButton camera = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarToggleButton && ((AppBarToggleButton)i).Name == "Camera") as AppBarToggleButton; camera.Visibility = Visibility.Collapsed; AppBarButton deleteroute = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "DeleteRoute") as AppBarButton; deleteroute.Visibility = Visibility.Collapsed; AppBarButton hornBtn = App.AppCommandBar.PrimaryCommands.ToList().FirstOrDefault(i => i is AppBarButton && ((AppBarButton)i).Name == "Horn") as AppBarButton; hornBtn.Visibility = Visibility.Collapsed; }
public ExtSplashScreen() { this.InitializeComponent(); this.BottomAppBar.Visibility = Windows.UI.Xaml.Visibility.Visible; this.ProgressGrid.Visibility = Windows.UI.Xaml.Visibility.Collapsed; Position(); LayoutUpdated += SplashScreen_LayoutUpdated; #if WINDOWS_APP AppBarButton BackButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Back/Label") }; BackButton.Click += Back_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(BackButton); #endif #if STORETOOLKIT AppBarButton RenderButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Camera), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Render/Label") }; RenderButton.Click += RenderPngs_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(RenderButton); #endif }
public MainPage() { this.DataContext = this; this.ViewModel = new MyTabViewModel(); UIChanger = new MyUIChanger(); this.InitializeComponent(); #if STORETOOLKIT AppBarButton RenderButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Camera), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Render/Label") }; RenderButton.Click += RenderPngs_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(RenderButton); #endif #if WINDOWS_PHONE_APP this.NavigationCacheMode = NavigationCacheMode.Required; #endif gestRec = new Windows.UI.Input.GestureRecognizer(); gestRec.GestureSettings = Windows.UI.Input.GestureSettings.HoldWithMouse | Windows.UI.Input.GestureSettings.Hold | Windows.UI.Input.GestureSettings.Tap | Windows.UI.Input.GestureSettings.DoubleTap | Windows.UI.Input.GestureSettings.RightTap; gestRec.Holding += OnHolding; gestRec.RightTapped += OnRightTapped; gestRec.Tapped += OnTapped; }
void BasePage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) { CommandBar commandBar = ((this.BottomAppBar == null) ? new CommandBar() : this.BottomAppBar as CommandBar); AppBarButton consultationButton = new AppBarButton(); AppBarButton configurationButton = new AppBarButton(); AppBarButton disconnectButton = new AppBarButton(); consultationButton.Label = "Consultation"; configurationButton.Label = "Configuration"; disconnectButton.Label = "Deconnexion"; consultationButton.Click += consultationButton_Click; configurationButton.Click += configurationButton_Click; commandBar.SecondaryCommands.Add(consultationButton); commandBar.SecondaryCommands.Add(configurationButton); commandBar.SecondaryCommands.Add(disconnectButton); this.BottomAppBar = commandBar; }
void SetupUserInterface () { takePhotoButton = new AppBarButton { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Icon = new SymbolIcon (Symbol.Camera) }; var commandBar = new CommandBar (); commandBar.PrimaryCommands.Add (takePhotoButton); captureElement = new CaptureElement (); captureElement.Stretch = Stretch.UniformToFill; var stackPanel = new StackPanel (); stackPanel.Children.Add (captureElement); page = new Page (); page.BottomAppBar = commandBar; page.Content = stackPanel; page.Unloaded += OnPageUnloaded; }
private void UpdateAppBar() { if (_page.BottomAppBar != null) { ((CommandBar)_page.BottomAppBar).PrimaryCommands.Clear(); } var commandBar = new CommandBar(); foreach (var toolbarItem in _tracker.ToolbarItems) { var button = new AppBarButton { Label = toolbarItem.Name, Icon = new BitmapIcon { UriSource = new Uri(toolbarItem.Icon.File) } }; ToolbarItem item = toolbarItem; button.Click += (s, e) => item.Activate(); commandBar.PrimaryCommands.Add(button); } _page.BottomAppBar = commandBar; }
private static void ActionsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var control = d as ActionsCommandBar; if (control != null) { foreach (var action in control.ActionsSource) { var label = GetText(action); var button = FindButton(label, control); if (button == null) { button = new AppBarButton(); if (action.Type == ActionType.Primary) { control.PrimaryCommands.Add(button); } else if (action.Type == ActionType.Secondary) { control.SecondaryCommands.Add(button); } } button.Command = action.Command; button.CommandParameter = action.CommandParameter; button.Label = label; if (Application.Current.Resources.ContainsKey(action.Style)) { button.Style = Application.Current.Resources[action.Style] as Style; } } } }
private void AddSecondaryCommands_Click(object sender, RoutedEventArgs e) { // Add compact button to the command bar. It provides functionality specific // to this page, and is removed when leaving the page. ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage; if (itemPage != null) { CommandBar commandBar = itemPage.BottomCommandBar; if (commandBar.SecondaryCommands.Count == 1) { var newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.Add); newButton.Label = "Button 1"; commandBar.SecondaryCommands.Add(newButton); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.Delete); newButton.Label = "Button 2"; commandBar.SecondaryCommands.Add(newButton); commandBar.SecondaryCommands.Add(new AppBarSeparator()); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.FontDecrease); newButton.Label = "Button 3"; commandBar.SecondaryCommands.Add(newButton); newButton = new AppBarButton(); newButton.Icon = new SymbolIcon(Symbol.FontIncrease); newButton.Label = "Button 4"; commandBar.SecondaryCommands.Add(newButton); } } }
public WordForWordUC() { this.DataContext = this; this.ViewModel = new VirtualizingWrapPanelAdapter(); UIChanger = new MyUIChanger(); this.InitializeComponent(); MainGrid.SizeChanged += OnSizeChanged; #if WINDOWS_APP AppBarButton BackButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Back/Label") }; BackButton.Click += Back_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(BackButton); #endif #if STORETOOLKIT AppBarButton RenderButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Camera), Label = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("Render/Label") }; RenderButton.Click += RenderPngs_Click; (this.BottomAppBar as CommandBar).PrimaryCommands.Add(RenderButton); #endif gestRec = new Windows.UI.Input.GestureRecognizer(); gestRec.GestureSettings = Windows.UI.Input.GestureSettings.HoldWithMouse | Windows.UI.Input.GestureSettings.Hold | Windows.UI.Input.GestureSettings.RightTap | Windows.UI.Input.GestureSettings.Tap; gestRec.Holding += OnHolding; gestRec.RightTapped += OnRightTapped; gestRec.Tapped += OnTapped; }
private void CreateCommands() { var acceptButton = new AppBarButton { Icon = new SymbolIcon(Symbol.Accept), Label = "GenericAccept".FromLanguageResource() }; acceptButton.Click += AcceptButtonOnClick; _reorderModeCommands = new List<ICommandBarElement> { acceptButton }; var deleteButton = new AppBarButton { Icon = new SymbolIcon(Symbol.Delete), Label = "GenericRemove".FromLanguageResource() }; deleteButton.Click += DeleteButtonOnClick; _selectionModeCommands = new List<ICommandBarElement> { deleteButton }; }
private void CreateApplicationBar() { bottomAppBar = new CommandBar(); // bottomAppBar.Style = (Style)App.Current.Resources["ApplicationBarStyle"]; btnSettings = new AppBarButton(); btnSettings.Label = "settings"; btnSettings.Icon = new SymbolIcon(Symbol.Setting); bottomAppBar.PrimaryCommands.Add(btnSettings); btnSettings.Click += btnSettings_Click; btnLogout = new AppBarButton(); btnLogout.Label = "logout"; btnLogout.Click += btnLogout_Click; bottomAppBar.SecondaryCommands.Add(btnLogout); // btnSettings.Click += btnSettings_Click; int result = AppStorage.GetIntValue(AppConstants.AUTHORIZED); if (result == 1) { btnAuthoriseClaims = new AppBarButton(); btnAuthoriseClaims.Label = "authorise Claims"; // btnAuthoriseClaims.Icon = new SymbolIcon(Symbol.Setting); bottomAppBar.SecondaryCommands.Add(btnAuthoriseClaims); } this.BottomAppBar = bottomAppBar; }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { // Save original AppBar so we can restore it afterward originalAppBar = rootPage.BottomAppBar; // Use a CommandBar rather than an AppBar so that we get default layout CommandBar commandBar = new CommandBar(); // Create the 'Add' button AppBarButton add = new AppBarButton(); add.Label = "Add"; add.Icon = new SymbolIcon(Symbol.Add); commandBar.PrimaryCommands.Add(add); // Create the 'Remove' button AppBarButton remove = new AppBarButton(); remove.Label = "Remove"; remove.Icon = new SymbolIcon(Symbol.Remove); commandBar.PrimaryCommands.Add(remove); commandBar.PrimaryCommands.Add(new AppBarSeparator()); // Create the 'Delete' button AppBarButton delete = new AppBarButton(); delete.Label = "Delete"; delete.Icon = new SymbolIcon(Symbol.Delete); commandBar.PrimaryCommands.Add(delete); // Create the 'Camera' button AppBarButton camera = new AppBarButton(); camera.Label = "Camera"; camera.Icon = new SymbolIcon(Symbol.Camera); commandBar.SecondaryCommands.Add(camera); // Create the 'Bold' button AppBarButton bold = new AppBarButton(); bold.Label = "Bold"; bold.Icon = new SymbolIcon(Symbol.Bold); commandBar.SecondaryCommands.Add(bold); // Create the 'Italic' button AppBarButton italic = new AppBarButton(); italic.Label = "Italic"; italic.Icon = new SymbolIcon(Symbol.Italic); commandBar.SecondaryCommands.Add(italic); // Create the 'Underline' button AppBarButton underline = new AppBarButton(); underline.Label = "Underline"; underline.Icon = new SymbolIcon(Symbol.Underline); commandBar.SecondaryCommands.Add(underline); // Create the 'Align Left' button AppBarButton left = new AppBarButton(); left.Label = "Align Left"; left.Icon = new SymbolIcon(Symbol.AlignLeft); commandBar.SecondaryCommands.Add(left); // Create the 'Align Center' button AppBarButton center = new AppBarButton(); center.Label = "Align Center"; center.Icon = new SymbolIcon(Symbol.AlignCenter); commandBar.SecondaryCommands.Add(center); // Create the 'Align Right' button AppBarButton right = new AppBarButton(); right.Label = "Align Right"; right.Icon = new SymbolIcon(Symbol.AlignRight); commandBar.SecondaryCommands.Add(right); rootPage.BottomAppBar = commandBar; }
/// <summary> /// Получить нижнюю строку команд. /// </summary> /// <returns>Строка команд.</returns> public AppBar GetBottomAppBar() { var appBar = new CommandBar(); var postButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Edit), Label = "Написать" }; postButton.Click += async (sender, e) => { try { var opPost = ViewModel?.OpPost; if (opPost != null) { ServiceLocator.Current.GetServiceOrThrow<IPageNavigationService>().Navigate(new PostingNavigationTarget(opPost.ParentLink, opPost.Text) ); } } catch (Exception ex) { await AppHelpers.ShowError(ex); } }; var syncButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Sync), Label = "Обновить" }; syncButton.SetBinding(AppBarButton.IsEnabledProperty, new Binding() { Source = this, Path = new PropertyPath("ViewModel.Update.CanStart") }); syncButton.Click += (sender, e) => ViewModel?.Synchronize(); appBar.PrimaryCommands.Add(postButton); if (currentContentView == PageContentViews.Default) { short downNum, upNum; unchecked { downNum = (short)0xE74B; upNum = (short)0xE74A; } var downButton = new AppBarButton() { Icon = new FontIcon() { FontFamily = new FontFamily("Segoe MDL2 Assets"), Glyph = new string(new[] { (char)downNum }) }, Label = "Вниз" }; downButton.Click += (sender, e) => Down(); var upButton = new AppBarButton() { Icon = new FontIcon() { FontFamily = new FontFamily("Segoe MDL2 Assets"), Glyph = new string(new[] { (char)upNum }) }, Label = "Вверх" }; upButton.Click += (sender, e) => Up(); appBar.PrimaryCommands.Add(upButton); appBar.PrimaryCommands.Add(downButton); } else if (currentContentView == PageContentViews.SinglePostView) { var backButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Back), Label = "Назад" }; backButton.Click += (sender, e) => SingleListBack(); var goButton = new AppBarButton() { Icon = new SymbolIcon(Symbol.Go), Label = "Перейти" }; goButton.Click += (sender, e) => SingleListGo(); appBar.PrimaryCommands.Add(backButton); appBar.PrimaryCommands.Add(goButton); } appBar.PrimaryCommands.Add(syncButton); var loadAllButton = new AppBarButton() { Label = "Загрузить заново", }; loadAllButton.Click += (sender, e) => { ViewModel?.FullReload(); }; var addToFavorites = new AppBarButton() { Label = "В избранное", }; addToFavorites.Click += async (sender, e) => { try { var vm = ViewModel; if (vm != null) { await vm.AddToFavorites(); } } catch (Exception ex) { await AppHelpers.ShowError(ex); } }; appBar.SecondaryCommands.Add(loadAllButton); appBar.SecondaryCommands.Add(addToFavorites); return appBar; }
/// <summary> /// Ajoute un bouton à la barre /// </summary> /// <param name="objectType">type d'objet à créer</param> /// <param name="emplacement">Type d'emplacment du bouton sur la CommandBar, PrimaryCommands ou SecondaryCommands</param> /// <param name="icon">Icon du bouton</param> /// <param name="label">Label du bouton</param> /// <param name="command">ICommand du bouton</param> /// <param name="commandParameter">CommandParameter de la ICommand du bouton</param> private static CommandBarElement AddObjectToCommandBar(CommandBarButtonType objectType, CommandBarEmplacement emplacement, IconElement icon, string label, ICommand command, object commandParameter, FlyoutBase flyout) { ICommandBarElement element = null; switch (objectType) { case CommandBarButtonType.Button: element = new AppBarButton { Icon = icon, Label = label, Command = command, CommandParameter = commandParameter }; break; case CommandBarButtonType.ToggleButton: element = new AppBarToggleButton() { Icon = icon, Label = label, Command = command, CommandParameter = commandParameter }; break; case CommandBarButtonType.FlyoutButton: element = new AppBarButton() { Icon = icon, Label = label, Flyout = flyout }; break; case CommandBarButtonType.Separator: element = new AppBarSeparator(); break; } if (element != null) { if (emplacement == CommandBarEmplacement.Primary) { _commandBar.PrimaryCommands.Add(element); } else { _commandBar.SecondaryCommands.Add(element); } if (_commandBar.Visibility == Visibility.Collapsed) { _commandBar.Visibility = Visibility.Visible; } } return new CommandBarElement() { Element = element, Emplacement = emplacement }; }
private void CreateAppBarButtons() { RouteCommandBar.PrimaryCommands.Clear(); RouteCommandBar.SecondaryCommands.Clear(); foreach (IAction action in Route.Actions) { AppBarButton locationSheetAppBarButton = new AppBarButton(); locationSheetAppBarButton.Icon = new SymbolIcon((Symbol)Enum.Parse(typeof(Symbol), action.Symbol, true)); locationSheetAppBarButton.Label = action.Text; locationSheetAppBarButton.Command = action.Action; locationSheetAppBarButton.CommandParameter = Route; RouteCommandBar.PrimaryCommands.Add(locationSheetAppBarButton); } foreach (IAction action in Route.SecondaryActions) { AppBarButton locationSheetAppBarButton = new AppBarButton(); locationSheetAppBarButton.Icon = new SymbolIcon((Symbol)Enum.Parse(typeof(Symbol), action.Symbol, true)); locationSheetAppBarButton.Label = action.Text; locationSheetAppBarButton.Command = action.Action; locationSheetAppBarButton.CommandParameter = Route; RouteCommandBar.SecondaryCommands.Add(locationSheetAppBarButton); } }
public void BindForegroundColor(AppBarButton button) { SetAppBarForegroundBinding(button); }
internal void SetCitiesPanel(ICollection<CitySettingsViewModel> cities, int currentIndex) { CitiesPanel.SelectionChanged -= CitiesPanel_SelectionChanged; CitiesPanel.ItemsSource = cities; foreach (var item in cities) { var b = new AppBarButton { Icon = new SymbolIcon(Symbol.Globe), Label = item.City, Name = item.Id }; b.Click += B_Click; ActionBar.SecondaryCommands.Add(b); } CitiesPanel.SelectedIndex = currentIndex; CitiesPanel.SelectionChanged += CitiesPanel_SelectionChanged; }
private void AddNewItemConfirmButton_Loaded(object sender, RoutedEventArgs e) { // This button is in a data template, so we can use the Loaded event to get a reference to it // You can't get at controls in Data Templates in Item Templates using their name AddNewItemConfirmButton = sender as AppBarButton; }
/// <summary> /// This method assigns the style to the app bar button. /// </summary> /// <param name="showPinButton">if set to <c>true</c> [show pin button].</param> private void ToggleAppBarButton(bool showPinButton, AppBarButton pinToStart) { if (pinToStart != null) { pinToStart.Icon = (showPinButton) ? new SymbolIcon(Symbol.Pin) : new SymbolIcon(Symbol.UnPin); pinToStart.Label = (showPinButton) ? "Pin To Start" : "Unpin"; } }