private void CreateSecondPage() { secondActionButton = new Button() { Text = "1", Size = new Size(72.0f, 72.0f) }; secondActionButton.Clicked += (object sender, ClickedEventArgs e) => { NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop(); }; secondAppBar = new AppBar("Second Page", secondActionButton); secondButton = new Button() { Text = "Click to prev", WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; secondButton.Clicked += (object sender, ClickedEventArgs e) => { NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop(); }; secondPage = new Page(secondAppBar, secondButton); NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(secondPage); }
/// <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) { // Preserve the app bar appBar = rootPage.BottomAppBar; // this ensures the app bar is not shown in this scenario rootPage.BottomAppBar = null; }
/// <summary> /// Initialize an AppBarHandler for a specific window /// </summary> /// <param name="winHandle">Handler of the window to hook into</param> public AppBarHandler(IntPtr winHandle) { edgeHandler = null; appbar = new AppBar(winHandle); AppBarIsActive = false; UsePrimaryMonitorOnly = false; }
private void CreateFirstPage() { firstActionButton = new Button() { Text = "2", Size = new Size(72.0f, 72.0f) }; firstActionButton.Clicked += (object sender, ClickedEventArgs e) => { CreateSecondPage(); }; firstAppBar = new AppBar("First Page", firstActionButton) { AutoNavigationContent = false }; firstButton = new Button() { Text = "Click to next", WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; firstButton.Clicked += (object sender, ClickedEventArgs e) => { CreateSecondPage(); }; firstPage = new Page(firstAppBar, firstButton); NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(firstPage); }
/// <summary> /// Activate the AppBar at the given location on the screen /// </summary> /// <param name="newLocat">Location of the AppBar</param> /// <returns>True if AppBar was successfully created</returns> public bool ActivateAppBar(ScreenEdge newLocat) { DeactivateAppBar(); Func <IEdgeHandler> edgeHandlerFact; if (EdgeHandlerFactory.TryGetValue(newLocat, out edgeHandlerFact)) { edgeHandler = edgeHandlerFact(); } else { return(false); } var winBounds = Windows.GetRectangle(appbar.hWnd); AppBarDimension = edgeHandler.GetCurrentDimension(winBounds); appbar = new AppBar(appbar.hWnd); if (!appbar.CreateNew()) { return(false); } CheckDockSize(AppBarDimension); SizeToNewValues(); SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; AppBarIsActive = true; return(true); }
public void Show(Page page, AppBar appbar, Button button, object context) { TweetsListPopup.IsOpen = true; feedsViewModel = (FeedsViewModel)context; TweetList.ItemsSource = feedsViewModel.TwitterFeedsList; FlyoutHelper.ShowRelativeToAppBar(TweetsListPopup, page, appbar, button); }
public SettingPage() : base() { InitializeComponent(); repositories = App.ViewModel.EmoticonList.Repositories; ResponsitoriesSelector.ItemsSource = repositories; repositories.CollectionChanged += Repositories_CollectionChanged; if (repositories.Count == 0) { ListEmptyLabel.Visibility = Visibility.Visible; ResponsitoriesSelector.Visibility = Visibility.Collapsed; } else { ListEmptyLabel.Visibility = Visibility.Collapsed; ResponsitoriesSelector.Visibility = Visibility.Visible; } updateWhenPicker.SelectedIndex = (int)App.Settings["updateWhen"]; updateWiFiSwitch.IsChecked = (bool)App.Settings["updateWiFi"]; RepositoriesAppBar = AppBar; }
private void Window_Loaded(object sender, RoutedEventArgs e) { //AcrylicBlur ab = new AcrylicBlur(this); //ab.EnableBlur(); WindowInteropHelper wndHelper = new WindowInteropHelper(this); int exStyle = (int)GetWindowLong(wndHelper.Handle, (int)GetWindowLongFields.GWL_EXSTYLE); exStyle |= (int)ExtendedWindowStyles.WS_EX_TOOLWINDOW; SetWindowLong(wndHelper.Handle, (int)GetWindowLongFields.GWL_EXSTYLE, (IntPtr)exStyle); appbarMessageId = AppBar.RegisterBar(this, Screen.PrimaryScreen, Width * App.DPI, Height * App.DPI, ABEdge.ABE_TOP); App.Configure(); DispatcherTimer disp = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Background, delegate { batteryGlyph.UnicodeString = (troll ? "\uEBB3" : "\uEBA8"); troll = !troll; }, Dispatcher); //CLOCK DispatcherTimer clock = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Background, delegate { textBlock_Clock.Text = DateTime.Now.ToString("HH:mm"); }, Dispatcher); }
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == appbarMessageId && appbarMessageId != -1) { if (msg == 0x0006) { AppBar.AppBarActivate(hwnd); } else { App.HideExplorerTaskbar(); } return(IntPtr.Zero); } else if (msg == WM_MOUSEACTIVATE) { handled = true; return(new IntPtr(MA_NOACTIVATE)); } else { return(IntPtr.Zero); } }
private async Task TurnPage(bool isRight) { _oldOffset = null; await _event.WaitAsync(); AppBar.CancelPageSelectionMode(); if (isRight) { await _readController.ShowNextPage(); } else { await _readController.ShowPrevPage(); } ViewModel.TokenOffset = _readController.Offset; AppBar.PageNumber = _readController.CurrentPage; PageCanvas.Manipulator.IsFirstPage = _readController.IsFirst; PageCanvas.Manipulator.IsLastPage = _readController.IsLast; PageCanvas.Manipulator.UpdatePanelsVisibility(); _event.Release(); }
//</SnippetFEActualHeight> void BottomAppBar_Closed(object sender, object e) { // AppBar has closed so we need to put the WebView back to its // original size/location. AppBar bottomAppBar = sender as AppBar; if (bottomAppBar != null) { // Force layout so that we can guarantee that our AppBar's // actual height has height this.UpdateLayout(); // Get the height of the AppBar double appBarHeight = bottomAppBar.ActualHeight; // Increase the height of the WebView to allow for the space // that was occupied by the AppBar WebView8.Height = WebView8.ActualHeight + appBarHeight; // Translate the WebView in the Y direction to allow for // the AppBar. Notice that we translate it by appBarHeight / 2.0. // This is because the WebView has VerticalAlignment and HorizontalAlignment // of 'Stretch' and when we reduce its size it reduces its overall size // from top and bottom by half the amount. TranslateYOpen.To = appBarHeight / 2.0; // Run our translate animation to match the AppBar CloseAppBar.Begin(); } }
/// Modify this method for adding other examples. public SwitchExample() : base() { Log.Info(this.GetType().Name, $"{this.GetType().Name} is contructed\n"); WidthSpecification = LayoutParamPolicies.MatchParent; HeightSpecification = LayoutParamPolicies.MatchParent; // Navigator bar title is added here. AppBar = new AppBar() { Title = "Switch Default Style", }; // Example root content view. // you can decorate, add children on this view. rootContent = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, CellPadding = new Size2D(10, 20), }, }; path = Tizen.Applications.Application.Current.DirectoryInfo.Resource; CreateSwitchView(); Content = rootContent; }
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e) { base.OnBackKeyPress(e); if (AppBar.IsOpen) { AppBar.Close(); e.Cancel = true; } if (_textManipulationListener != null && _textManipulationListener.IsAttached) { ClearTextSelection(); e.Cancel = true; } if (TranslationControl.IsOpen) { TranslationControl.Hide(); e.Cancel = true; } if (_oldOffset != null) { ViewModel.TokenOffset = _oldOffset.Value; _oldOffset = null; CreateController(); e.Cancel = true; } }
public NavigatorContentPage4(Window win) { window = win; WidthSpecification = LayoutParamPolicies.MatchParent; HeightSpecification = LayoutParamPolicies.MatchParent; AppBar = new AppBar() { Title = "Navigator Sample", }; var button = new Button() { Text = "Click to show Navigator", WidthSpecification = 400, HeightSpecification = 100, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, PositionUsesPivotPoint = true, Focusable = true, }; Content = button; button.Clicked += (object sender, ClickedEventArgs e) => { PushPopNavigator(window); }; //navigator = window.GetDefaultNavigator(); }
public void AppBarGetNextFocusableView() { tlog.Debug(tag, $"AppBarGetNextFocusableView START"); var testingTarget = new AppBar() { Size = new Size(200, 600), }; Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <AppBar>(testingTarget, "Should return AppBar instance."); testingTarget.NavigationContent = new View() { Size = new Size(200, 500), }; testingTarget.TitleContent = new View() { Size = new Size(200, 100), }; try { testingTarget.GetNextFocusableView(testingTarget.TitleContent, View.FocusDirection.Down, true); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } testingTarget.Dispose(); tlog.Debug(tag, $"AppBarGetNextFocusableView END (OK)"); }
private void ShowAppBar(AppBar appBar) { if (appBar != null) { appBar.IsOpen = true; } }
public static void ShowRelativeToAppBar(Popup popup, Page page, AppBar appbar, Button button) { Func <UIElement, UIElement, Point> getOffset = delegate(UIElement control1, UIElement control2) { return(control1.TransformToVisual(control2) .TransformPoint(new Point(0, 0))); }; Point popupOffset = getOffset(popup, page); Point buttonOffset = getOffset(button, page); popup.HorizontalOffset = buttonOffset.X - popupOffset.X - (popup.ActualWidth / 2) + (button.ActualWidth / 2); popup.VerticalOffset = getOffset(appbar, page).Y - popupOffset.Y - popup.ActualHeight; if (popupOffset.X + popup.HorizontalOffset + popup.ActualWidth > page.ActualWidth) { popup.HorizontalOffset = page.ActualWidth - popupOffset.X - popup.ActualWidth; } else if (popup.HorizontalOffset + popupOffset.X < 0) { popup.HorizontalOffset = -popupOffset.X; } }
public override void OnInspectorGUI() { BoundingBoxTarget bbt = (BoundingBoxTarget)target; // See if there's a bounding box yet BoundingBoxManipulate bbm = GameObject.FindObjectOfType <BoundingBoxManipulate>(); AppBar toolbar = GameObject.FindObjectOfType <AppBar>(); if (bbm == null || toolbar == null) { HUXEditorUtils.ErrorMessage( "Couldn't find a bounding box prefab and/or manipulation toolbar in the scene. Bounding box target won't work without them.", AddBoundingBox); } HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnSelected"); HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnDeselected"); bbt.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbt.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); bbt.ShowAppBar = EditorGUILayout.Toggle("Toolbar Display", bbt.ShowAppBar); HUXEditorUtils.SaveChanges(bbt); }
private void Attach(AppBar appBar) { _appBar = appBar; Window.Current.SizeChanged += WindowSizeChanged; _appBar.Unloaded += OnAppBarUnloaded; UpdateAppBarVisibility(); }
private static void OpenAppBar(AppBar appBar) { if (appBar != null && !appBar.IsOpen) { appBar.IsOpen = true; } }
/// Modify this method for adding other examples. public ContentPageExample() : base() { window = NUIApplication.GetDefaultWindow(); WidthSpecification = LayoutParamPolicies.MatchParent; HeightSpecification = LayoutParamPolicies.MatchParent; // Navigator bar title is added here. AppBar = new AppBar() { Title = "ContentPage Default Style", }; navigator = window.GetDefaultNavigator(); pageCount = navigator.PageCount; contentPage1 = new ContentPage() { AppBar = new AppBar() { Title = "ContentPageTestPage1", }, }; var buttonOne = new Button() { Text = "ONE", WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; buttonOne.Clicked += (s, e) => { navigator?.Push(contentPage2); }; contentPage1.Content = buttonOne; contentPage2 = new ContentPage() { AppBar = new AppBar() { Title = "ContentPageTestPage2", }, }; var buttonTwo = new Button() { Text = "TWO", WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; buttonTwo.Clicked += (s, e) => { navigator?.Pop(); }; contentPage2.Content = buttonTwo; Content = contentPage1; }
private void RemoveDismissListners(AppBar app) { if (app != null) { app.Closed -= DismissPopup; app.Opened -= DismissPopup; } }
private void AddDismissListners(AppBar app) { if (app != null) { app.Closed += DismissPopup; app.Opened += DismissPopup; } }
/// <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) { // Preserve the app bar appBar = rootPage.BottomAppBar; // this ensures the app bar is not shown in this scenario rootPage.BottomAppBar = null; ToggleButtons(SecondaryTile.Exists(MainPage.dynamicTileId)); }
public static void ShowExplorerTaskbar() { //Reset. AppBar.SetWinTaskbarState(AppBar.WinTaskbarState.OnTop); //Reset. AppBar.SetWinTaskbarPos((int)NativeMethods.SetWindowPosFlags.SWP_SHOWWINDOW); }
public static void HideExplorerTaskbar() { //Enable Autohide. AppBar.SetWinTaskbarState(AppBar.WinTaskbarState.AutoHide); //puff, disappear. AppBar.SetWinTaskbarPos((int)NativeMethods.SetWindowPosFlags.SWP_HIDEWINDOW); }
public void Activate() { var window = NUIApplication.GetDefaultWindow(); var navigator = window.GetDefaultNavigator(); var pageContent = new Button() { Text = "Page Content", CornerRadius = 0, WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; var moreButton = new Button() { Text = "More", }; var appBar = new AppBar() { AutoNavigationContent = false, Title = "Title", Actions = new View[] { moreButton, }, }; var page = new ContentPage() { AppBar = appBar, Content = pageContent, }; navigator.Push(page); for (int i = 0; i < itemCount; i++) { menuItems[i] = new MenuItem() { Text = "Menu" + (i + 1) }; menuItems[i].SelectedChanged += (object sender, SelectedChangedEventArgs args) => { var menuItem = sender as MenuItem; global::System.Console.WriteLine($"{menuItem.Text}'s IsSelected is changed to {args.IsSelected}."); }; } moreButton.Clicked += (object sender, ClickedEventArgs args) => { var menu = new Menu() { Anchor = moreButton, HorizontalPositionToAnchor = Menu.RelativePosition.Center, VerticalPositionToAnchor = Menu.RelativePosition.End, Items = menuItems, }; menu.Post(); }; }
/// Modify this method for adding other examples. public AppBarExample() : base() { WidthSpecification = LayoutParamPolicies.MatchParent; HeightSpecification = LayoutParamPolicies.MatchParent; // Navigator bar title is added here. AppBar = new AppBar() { Title = "AppBar Default Style", }; // Example root content view. // you can decorate, add children on this view. rootContent = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, CellPadding = new Size2D(10, 20), }, }; // AppBar examples. appBar = new AppBar() { WidthSpecification = LayoutParamPolicies.MatchParent, Title = "This is AppBar", AutoNavigationContent = false, }; rootContent.Add(appBar); label = new TextLabel { WidthSpecification = LayoutParamPolicies.MatchParent, Text = $"title: {appBar.Title}" }; rootContent.Add(label); button = new Tizen.NUI.Components.Button { WidthSpecification = LayoutParamPolicies.MatchParent, Text = "change title" }; rootContent.Add(button); button.Clicked += (s, e) => { appBar.Title = $"This is AppBar(clk {count++})"; label.Text = $"title: {appBar.Title}"; }; Content = rootContent; }
/// Modify this method for adding other examples. public ScrollableBaseExample() : base() { Log.Info(this.GetType().Name, $"{this.GetType().Name} is contructed\n"); // Navigator bar title is added here. AppBar = new AppBar() { Title = "ScrollableBase Default Style", }; directionMenu = new List <DirectionOption>(); directionMenu.Add(new DirectionOption("Vertical")); directionMenu.Add(new DirectionOption("Horizontal")); // Example root content view. // you can decorate, add children on this view. // ScrollableBase need two different style guide. // so here we adding new CollectionView for 2-depth option. var directionListView = new CollectionView() { WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, ItemsSource = directionMenu, ItemsLayouter = new LinearLayouter(), ItemTemplate = new DataTemplate(() => { DefaultLinearItem item = new DefaultLinearItem() { WidthSpecification = LayoutParamPolicies.MatchParent, }; item.Label.SetBinding(TextLabel.TextProperty, "Direction"); item.Label.HorizontalAlignment = HorizontalAlignment.Begin; item.EnableFocus(); return(item); }), ScrollingDirection = ScrollableBase.Direction.Vertical, SelectionMode = ItemSelectionMode.SingleAlways, }; directionListView.SelectionChanged += (object colView, SelectionChangedEventArgs ev) => { if (ev.CurrentSelection.Count == 0) { return; } if (ev.CurrentSelection[0] is DirectionOption directionItem) { Log.Info(this.GetType().Name, $"{directionItem.Direction} will be activated!\n"); Page scrollDirPage = new ScrollableBaseDirectionExample(directionItem.Direction); window = NUIApplication.GetDefaultWindow(); window.GetDefaultNavigator().Push(scrollDirPage); FocusableExtension.SetFocusOnPage(scrollDirPage); } directionListView.SelectedItem = null; }; Content = directionListView; }
void FlatNavigationPage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) { Current = this; AppBar appBar = new AppBar(); appBar.Content = new FlatNavigationControl(); this.TopAppBar = appBar; }
public static void Initialize(AppBar window, Hotkey[] settings) { if (settings == null) { return; } Disable(); _window = window; _index = 0; RegisteredKeys = settings.Select(h => { h.Index = _index; _index++; return h; }).ToArray(); (PresentationSource.FromVisual(window) as HwndSource).AddHook(KeyHook); }
public SettingsModel(AppBar appbar) { DockEdgeItems = new DockEdge[2] { DockEdge.Left, DockEdge.Right }; DockEdge = Properties.Settings.Default.DockEdge; Monitor[] _monitors = Monitor.GetMonitors(); ScreenItems = _monitors.Select((s, i) => new ScreenItem() { Index = i, Text = string.Format("#{0}", i + 1) }).ToArray(); if (Properties.Settings.Default.ScreenIndex < _monitors.Length) { ScreenIndex = Properties.Settings.Default.ScreenIndex; } else { ScreenIndex = _monitors.Where(s => s.IsPrimary).Select((s, i) => i).Single(); } XOffset = Properties.Settings.Default.XOffset; YOffset = Properties.Settings.Default.YOffset; PollingInterval = Properties.Settings.Default.PollingInterval; UseAppBar = Properties.Settings.Default.UseAppBar; AlwaysTop = Properties.Settings.Default.AlwaysTop; HighDPISupport = Properties.Settings.Default.HighDPISupport; ClickThrough = Properties.Settings.Default.ClickThrough; ShowTrayIcon = Properties.Settings.Default.ShowTrayIcon; CheckForUpdates = Properties.Settings.Default.CheckForUpdates; RunAtStartup = Startup.StartupTaskExists(); SidebarWidth = Properties.Settings.Default.SidebarWidth; BGColor = Properties.Settings.Default.BGColor; BGOpacity = Properties.Settings.Default.BGOpacity; FontSettingItems = new FontSetting[5] { FontSetting.x10, FontSetting.x12, FontSetting.x14, FontSetting.x16, FontSetting.x18 }; FontSetting = Properties.Settings.Default.FontSetting; FontColor = Properties.Settings.Default.FontColor; AlertFontColor = Properties.Settings.Default.AlertFontColor; DateSettingItems = new DateSetting[4] { DateSetting.Disabled, DateSetting.Short, DateSetting.Normal, DateSetting.Long }; DateSetting = Properties.Settings.Default.DateSetting; CollapseMenuBar = Properties.Settings.Default.CollapseMenuBar; ShowClock = Properties.Settings.Default.ShowClock; Clock24HR = Properties.Settings.Default.Clock24HR; if (appbar.Ready) { foreach (MonitorConfig _record in Properties.Settings.Default.MonitorConfig) { _record.Hardware = ( from hw in appbar.Model.MonitorManager.GetHardware(_record.Type) join config in _record.Hardware on hw.ID equals config.ID into c from config in c.DefaultIfEmpty(hw) select config ).ToArray(); } } MonitorConfig = Properties.Settings.Default.MonitorConfig; if (Properties.Settings.Default.Hotkeys != null) { ToggleKey = Properties.Settings.Default.Hotkeys.FirstOrDefault(k => k.Action == Hotkey.KeyAction.Toggle); ShowKey = Properties.Settings.Default.Hotkeys.FirstOrDefault(k => k.Action == Hotkey.KeyAction.Show); HideKey = Properties.Settings.Default.Hotkeys.FirstOrDefault(k => k.Action == Hotkey.KeyAction.Hide); ReloadKey = Properties.Settings.Default.Hotkeys.FirstOrDefault(k => k.Action == Hotkey.KeyAction.Reload); CloseKey = Properties.Settings.Default.Hotkeys.FirstOrDefault(k => k.Action == Hotkey.KeyAction.Close); } IsChanged = false; }