private void QuickStartGridView_Holding(object sender, Windows.UI.Xaml.Input.HoldingRoutedEventArgs e) { if (e.HoldingState == HoldingState.Started) { if ((sender as GridView).Name == nameof(QuickStartGridView)) { if ((e.OriginalSource as FrameworkElement)?.DataContext is QuickStartItem Item) { CurrentSelectedItem = Item; QuickStartGridView.ContextFlyout = AppFlyout; } else { QuickStartGridView.ContextFlyout = AppEmptyFlyout; } } else { if ((e.OriginalSource as FrameworkElement)?.DataContext is QuickStartItem Item) { CurrentSelectedItem = Item; WebGridView.ContextFlyout = WebFlyout; } else { WebGridView.ContextFlyout = WebEmptyFlyout; } } } }
private void QuickStartGridView_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e) { if (e.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) { if ((sender as GridView).Name == nameof(QuickStartGridView)) { if ((e.OriginalSource as FrameworkElement)?.DataContext is QuickStartItem Item) { CurrentSelectedItem = Item; QuickStartGridView.ContextFlyout = AppFlyout; } else { QuickStartGridView.ContextFlyout = AppEmptyFlyout; } } else { if ((e.OriginalSource as FrameworkElement)?.DataContext is QuickStartItem Item) { CurrentSelectedItem = Item; WebGridView.ContextFlyout = WebFlyout; } else { WebGridView.ContextFlyout = WebEmptyFlyout; } } } }
public QuickStartModifiedDialog(QuickStartItem Item) { InitializeComponent(); Type = Item.Type; IsUpdate = true; switch (Item.Type) { case QuickStartType.Application: { Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Application_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickLogo.Visibility = Visibility.Collapsed; PickApp.Visibility = Visibility.Visible; Icon.Source = Item.Image; DisplayName.Text = Item.DisplayName; Protocol.Text = Item.Protocol.ToString(); QuickItem = Item; break; } case QuickStartType.WebSite: { Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Web_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickLogo.Visibility = Visibility.Visible; PickApp.Visibility = Visibility.Collapsed; Icon.Source = Item.Image; DisplayName.Text = Item.DisplayName; Protocol.Text = Item.Protocol.ToString(); QuickItem = Item; break; } } }
public QuickStartModifiedDialog(QuickStartType Type, QuickStartItem Item = null) { InitializeComponent(); this.Type = Type; switch (Type) { case QuickStartType.Application: { Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Application_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickerFile.Visibility = Visibility.Visible; break; } case QuickStartType.WebSite: { Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Web_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickerFile.Visibility = Visibility.Collapsed; break; } case QuickStartType.UpdateApp: { if (Item == null) { throw new ArgumentNullException(nameof(Item), "Parameter could not be null"); } Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Application_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickerFile.Visibility = Visibility.Visible; Icon.Source = Item.Image; DisplayName.Text = Item.DisplayName; Protocol.Text = Item.Protocol.ToString(); QuickItem = Item; break; } case QuickStartType.UpdateWeb: { if (Item == null) { throw new ArgumentNullException(nameof(Item), "Parameter could not be null"); } Protocol.PlaceholderText = Globalization.GetString("QuickStart_Protocol_Web_PlaceholderText"); GetImageAutomatic.Visibility = Visibility.Visible; PickerFile.Visibility = Visibility.Collapsed; Icon.Source = Item.Image; DisplayName.Text = Item.DisplayName; Protocol.Text = Item.Protocol.ToString(); QuickItem = Item; break; } } }
void Layout() { if (banner == null) { banner = new BannerItem(this); } items.Clear(); items.Add(banner); Item item = new LabelItem(this, "Common Actions:", 0, banner.Bounds.Bottom + 3 * padding); items.Add(item); item = new LinkItem(this, "Create New Profile", StartEventType.Create, null, 0, item.Bounds.Bottom + text_padding); items.Add(item); item = new LinkItem(this, "Open Profile Log File", StartEventType.Open, null, 0, item.Bounds.Bottom); items.Add(item); int y = item.Bounds.Bottom + 3 * padding; if (history.LogFiles.Count > 0) { item = new LabelItem(this, "Recent Logs:", 0, y); y = item.Bounds.Bottom + text_padding; items.Add(item); foreach (LogInfo info in history.LogFiles) { item = new LinkItem(this, info.Caption, info.Detail, StartEventType.Open, info.Filename, 0, y); items.Add(item); y = item.Bounds.Bottom; } } int x = Allocation.Width / 2; if (history.Configs.Count > 0) { item = new LabelItem(this, "Quick Sessions:", x, banner.Bounds.Bottom + 3 * padding); items.Add(item); y = item.Bounds.Bottom + text_padding; foreach (ProfileConfiguration config in history.Configs) { string text = config.ToString(); int idx = text.IndexOf(":"); item = new QuickStartItem(this, config, text.Substring(0, idx), text.Substring(idx + 1), x, y); items.Add(item); y = item.Bounds.Bottom; } } }
void Layout() { if (banner == null) banner = new BannerItem (this); items.Clear (); items.Add (banner); Item item = new LabelItem (this, "Common Actions:", 0, banner.Bounds.Bottom + 3 * padding); items.Add (item); item = new LinkItem (this, "Create New Profile", StartEventType.Create, null, 0, item.Bounds.Bottom + text_padding); items.Add (item); item = new LinkItem (this, "Open Profile Log File", StartEventType.Open, null, 0, item.Bounds.Bottom); items.Add (item); int y = item.Bounds.Bottom + 3 * padding; if (history.LogFiles.Count > 0) { item = new LabelItem (this, "Recent Logs:", 0, y); y = item.Bounds.Bottom + text_padding; items.Add (item); foreach (LogInfo info in history.LogFiles) { item = new LinkItem (this, info.Caption, info.Detail, StartEventType.Open, info.Filename, 0, y); items.Add (item); y = item.Bounds.Bottom; } } int x = Allocation.Width / 2; if (history.Configs.Count > 0) { item = new LabelItem (this, "Quick Sessions:", x, banner.Bounds.Bottom + 3 * padding); items.Add (item); y = item.Bounds.Bottom + text_padding; foreach (ProfileConfiguration config in history.Configs) { string text = config.ToString (); int idx = text.IndexOf (":"); item = new QuickStartItem (this, config, text.Substring (0, idx), text.Substring (idx + 1), x, y); items.Add (item); y = item.Bounds.Bottom; } } }