private void applyAcrylicAccent(Panel panel) { if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { return; } if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush")) { var ac = new AcrylicBrush(); var brush = Resources["SystemControlChromeMediumLowAcrylicElementMediumBrush"] as AcrylicBrush; ac = brush; ac.TintOpacity = 0.7; ac.BackgroundSource = AcrylicBackgroundSource.Backdrop; Split.PaneBackground = ac; return; } if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Hosting.ElementCompositionPreview", "SetElementChildVisual")) { _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor; _hostSprite = _compositor.CreateSpriteVisual(); _hostSprite.Size = new Vector2((float)panel.ActualWidth, (float)panel.ActualHeight); ElementCompositionPreview.SetElementChildVisual(panel, _hostSprite); var b = _compositor.CreateHostBackdropBrush(); _hostSprite.Brush = _compositor.CreateHostBackdropBrush(); } }
public SearchUserControl() { this.InitializeComponent(); if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { this.Height = 48; } this.DataContext = new ViewModel(); SearchBox.LostFocus += SearchBox_LostFocus; }
public MainPage(object parameter = null) { this.InitializeComponent(); if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { ImageLoader.Initialize(ElementCompositionPreview.GetElementVisual(this).Compositor); } SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested; this.Loaded += MainPage_Loaded; RootFrame = Fr; Grid = Gr; para = parameter; }
private void StartFluent() { if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { return; } if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Hosting.ElementCompositionPreview", "SetElementChildVisual")) { ApplicationViewTitleBar formattableTitleBar = ApplicationView.GetForCurrentView().TitleBar; formattableTitleBar.ButtonBackgroundColor = Colors.Transparent; CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; } }
public static MapInteractionMode GetRotationControlsVisible() { try { var r = ApplicationData.Current.LocalSettings.Values["RotationControlsVisible2"].ToString(); return(SettingsMainVM.StringToEnumConverter(r)); //return (MapInteractionMode)ApplicationData.Current.LocalSettings.Values["RotationControlsVisible"]; } catch { if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { SetRotationControlsVisible(MapInteractionMode.GestureOnly); return(MapInteractionMode.GestureAndControl); } else { SetRotationControlsVisible(MapInteractionMode.GestureAndControl); return(MapInteractionMode.GestureAndControl); } } }
private async void MainPage_Loaded(object sender, RoutedEventArgs e) { Fr.Navigate(typeof(MapView), para); applyAcrylicAccent(MainGrid); HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringMapView", "Text"), Icon = "", Tag = "Map View" }); HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringOfflineMaps", "Text"), Icon = "", Tag = "Offline Maps" }); try { if (CurrentAppSimulator.LicenseInformation.IsTrial) { var exp = CurrentAppSimulator.LicenseInformation.ExpirationDate; if (exp.Subtract(DateTime.Now) <= new TimeSpan(4, 0, 0, 0)) { await new MessageDialog("Application will be expired on " + exp.ToString()).ShowAsync(); } } // HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" }); } catch { //HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" }); } HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSendFeedback", "Text"), Icon = "", Tag = "Send feedback" }); HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSettings", "Text"), Icon = "", Tag = "Settings" }); if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; } return; }
private void MainPage_Loaded(object sender, RoutedEventArgs e) { Fr.Navigate(typeof(MapView), para); applyAcrylicAccent(MainGrid); HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringMapView", "Text"), Icon = "", Tag = "Map View" }); HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringOfflineMaps", "Text"), Icon = "", Tag = "Offline Maps" }); try { if (CurrentAppSimulator.LicenseInformation.IsTrial) { HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" }); } } catch { HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" }); } HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSendFeedback", "Text"), Icon = "", Tag = "Send feedback" }); HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSettings", "Text"), Icon = "", Tag = "Settings" }); if (ClassInfo.DeviceType() == ClassInfo.DeviceTypeEnum.Phone) { DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; } return; }