mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Setting v2: added power preview settings (#1702)
* added power preview settings * Added link to module oververview * create settings file if one is not found * removed run oon start up speficic callback * Update src/core/Microsoft.PowerToys.Settings.UI.Lib/ModuleSettings.cs Co-Authored-By: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com> * fixed merge conflicts Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// <copyright file="GeneralPage.xaml.cs" company="Microsoft Corp">
|
||||
// <copyright file="GeneralPage.xaml.cs" company="Microsoft Corp">
|
||||
// Copyright (c) Microsoft Corp. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
@@ -35,14 +35,32 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// <inheritdoc/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
//GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
// load and apply theme settings
|
||||
// this.ReLoadTheme(settings.theme);
|
||||
GeneralSettings settings = null;
|
||||
try
|
||||
{
|
||||
// get settings file if they exist.
|
||||
settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
// load and apply theme settings
|
||||
this.ReLoadTheme(settings.theme);
|
||||
|
||||
// load run on start up ui settings value and update the ui state.
|
||||
//this.ToggleSwitch_RunAtStartUp.IsOn = settings.startup;
|
||||
// load run on start-up settings value and update the ui state.
|
||||
this.ToggleSwitch_RunAtStartUp.IsOn = settings.startup;
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
// create settings file if one is not found.
|
||||
settings = new GeneralSettings();
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
// load and apply theme settings
|
||||
this.ReLoadTheme(settings.theme);
|
||||
|
||||
// load run on start up ui settings value and update the ui state.
|
||||
this.ToggleSwitch_RunAtStartUp.IsOn = settings.startup;
|
||||
}
|
||||
|
||||
ShellPage.ShellHandler.HideContributorsList();
|
||||
ShellPage.ShellHandler.HideFeatureDetails();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,9 +108,9 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
||||
if (ShellPage.Run_OnStartUp_Callback != null)
|
||||
if (ShellPage.Default_SndMSG_Callback != null)
|
||||
{
|
||||
ShellPage.Run_OnStartUp_Callback(outsettings.ToString());
|
||||
ShellPage.Default_SndMSG_Callback(outsettings.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,9 +121,9 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
settings.run_elevated = true;
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
||||
if (ShellPage.Restart_Elevated_Callback != null)
|
||||
if (ShellPage.Default_SndMSG_Callback != null)
|
||||
{
|
||||
ShellPage.Restart_Elevated_Callback(outsettings.ToString());
|
||||
ShellPage.Default_SndMSG_Callback(outsettings.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +139,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
// update and save settings to file.
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
settings.theme = themeName;
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings,string.Empty);
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerPreviewPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="These settings allow you to manage your Windows File Explorer Addons."
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<ToggleSwitch Header="Svg Preview Handler"
|
||||
x:Name="ToggleSwitch_Preview_SVG"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
Toggled="ToggleSwitch_Preview_SVG_Toggled" />
|
||||
|
||||
<ToggleSwitch Header="Markdown Preview Handler"
|
||||
x:Name="ToggleSwitch_Preview_MD"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
Toggled="ToggleSwitch_Preview_MD_Toggled" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,99 @@
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.ServiceModel.Channels;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Popups;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class PowerPreviewPage : Page
|
||||
{
|
||||
private const string POWERTOY_NAME = "File Explorer Preview";
|
||||
|
||||
public PowerPreviewPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
PowerPreviewSettings settings;
|
||||
try
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
settings = SettingsUtils.GetSettings<PowerPreviewSettings>(POWERTOY_NAME);
|
||||
ToggleSwitch_Preview_SVG.IsOn = settings.properties.IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL.value;
|
||||
ToggleSwitch_Preview_MD.IsOn = settings.properties.PREVPANE_MD_BOOL_TOGGLE_CONTROLL_ID.value;
|
||||
}
|
||||
catch(Exception exp)
|
||||
{
|
||||
settings = new PowerPreviewSettings(POWERTOY_NAME);
|
||||
SettingsUtils.SaveSettings<PowerPreviewSettings>(settings, POWERTOY_NAME);
|
||||
ToggleSwitch_Preview_SVG.IsOn = settings.properties.IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL.value;
|
||||
ToggleSwitch_Preview_MD.IsOn = settings.properties.PREVPANE_MD_BOOL_TOGGLE_CONTROLL_ID.value;
|
||||
}
|
||||
|
||||
ShellPage.ShellHandler.ShowFeatureDetails();
|
||||
|
||||
ShellPage.ShellHandler.SetFeatureDetails(
|
||||
"https://github.com/microsoft/PowerToys/tree/master/src/modules/previewpane",
|
||||
"https://github.com/microsoft/PowerToys/issues");
|
||||
|
||||
ShellPage.ShellHandler.HideContributorsList();
|
||||
}
|
||||
|
||||
private void ToggleSwitch_Preview_SVG_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ToggleSwitch swt = sender as ToggleSwitch;
|
||||
|
||||
if (swt != null)
|
||||
{
|
||||
PowerPreviewSettings settings = SettingsUtils.GetSettings<PowerPreviewSettings>(POWERTOY_NAME);
|
||||
settings.properties.IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL.value = swt.IsOn;
|
||||
|
||||
SndModuleSettings<PowerPreviewSettings> moduleSettings = new SndModuleSettings<PowerPreviewSettings>(settings);
|
||||
|
||||
if (ShellPage.Default_SndMSG_Callback != null)
|
||||
{
|
||||
ShellPage.Default_SndMSG_Callback(moduleSettings.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitch_Preview_MD_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ToggleSwitch swt = sender as ToggleSwitch;
|
||||
|
||||
if (swt != null)
|
||||
{
|
||||
PowerPreviewSettings settings = SettingsUtils.GetSettings<PowerPreviewSettings>(POWERTOY_NAME);
|
||||
settings.properties.PREVPANE_MD_BOOL_TOGGLE_CONTROLL_ID.value = swt.IsOn;
|
||||
|
||||
SndModuleSettings<PowerPreviewSettings> moduleSettings = new SndModuleSettings<PowerPreviewSettings>(settings);
|
||||
|
||||
if (ShellPage.Default_SndMSG_Callback != null)
|
||||
{
|
||||
ShellPage.Default_SndMSG_Callback(moduleSettings.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl
|
||||
<UserControl
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.ShellPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -41,8 +41,8 @@
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<winui:NavigationView
|
||||
|
||||
<winui:NavigationView
|
||||
x:Name="navigationView"
|
||||
IsBackButtonVisible="Collapsed"
|
||||
IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}"
|
||||
@@ -62,96 +62,106 @@
|
||||
|
||||
|
||||
</winui:NavigationView.PaneHeader> -->
|
||||
<winui:NavigationView.MenuItems>
|
||||
<!--
|
||||
<winui:NavigationView.MenuItems>
|
||||
<!--
|
||||
TODO WTS: Change the symbols for each item as appropriate for your app
|
||||
More on Segoe UI Symbol icons: https://docs.microsoft.com/windows/uwp/style/segoe-ui-symbol-font
|
||||
Or to use an IconElement instead of a Symbol see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/projectTypes/navigationpane.md
|
||||
Edit String/en-US/Resources.resw: Add a menu item title for each page
|
||||
-->
|
||||
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
<winui:NavigationViewItem x:Uid="Shell_General" helpers:NavHelper.NavigateTo="views:GeneralPage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_PowerRename" helpers:NavHelper.NavigateTo="views:PowerRenamePage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_PowerRename" helpers:NavHelper.NavigateTo="views:PowerRenamePage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_ShortcutGuide" helpers:NavHelper.NavigateTo="views:ShortcutGuidePage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_ShortcutGuide" helpers:NavHelper.NavigateTo="views:ShortcutGuidePage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_PowerLauncher" helpers:NavHelper.NavigateTo="views:PowerLauncherPage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
</winui:NavigationView.MenuItems>
|
||||
<i:Interaction.Behaviors>
|
||||
<behaviors:NavigationViewHeaderBehavior
|
||||
<!-- TO DO: Update icon -->
|
||||
<winui:NavigationViewItem x:Uid="Shell_PowerLauncher" helpers:NavHelper.NavigateTo="views:PowerLauncherPage">
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
|
||||
<winui:NavigationViewItem x:Uid="Shell_PowerPreview" helpers:NavHelper.NavigateTo="views:PowerPreviewPage" >
|
||||
<winui:NavigationViewItem.Icon>
|
||||
<PathIcon Data="M608 128q45 0 77 9t58 24 46 31 40 31 44 23 55 10h992q27 0 50 10t40 27 28 41 10 50v384h-128V384H928q-31 0-54 9t-44 24-41 31-45 31-58 23-78 10H128v1152h128v128H0V256q0-27 10-50t27-40 41-28 50-10h480zm0 256q24 0 42-4t33-13 29-20 32-27q-17-15-31-26t-30-20-33-13-42-5H128v128h480zm1440 512v1152H384V896h1664zm-128 128H512v896h1408v-896zm-128 256h-384v-128h384v128zm-128 256h-256v-128h256v128zm0 256h-256v-128h256v128zm-384 0H640v-640h640v640zm-128-512H768v384h384v-384z" ></PathIcon>
|
||||
</winui:NavigationViewItem.Icon>
|
||||
</winui:NavigationViewItem>
|
||||
</winui:NavigationView.MenuItems>
|
||||
<i:Interaction.Behaviors>
|
||||
<behaviors:NavigationViewHeaderBehavior
|
||||
DefaultHeader="{x:Bind ViewModel.Selected.Content, Mode=OneWay}">
|
||||
<behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<!-- TODO: Style clean up-->
|
||||
<Grid Margin="0, 24, 0, 6">
|
||||
<TextBlock
|
||||
<behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<!-- TODO: Style clean up-->
|
||||
<Grid Margin="0, 24, 0, 6">
|
||||
<TextBlock
|
||||
Text="{Binding}"
|
||||
FontWeight="Bold"
|
||||
Style="{ThemeResource TitleTextBlockStyle}"
|
||||
Margin="{StaticResource SmallLeftRightMargin}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
|
||||
</behaviors:NavigationViewHeaderBehavior>
|
||||
<ic:EventTriggerBehavior EventName="ItemInvoked">
|
||||
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ItemInvokedCommand}" />
|
||||
</ic:EventTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
<ScrollViewer Grid.Column="0">
|
||||
<Grid RowSpacing="32"
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</behaviors:NavigationViewHeaderBehavior.DefaultHeaderTemplate>
|
||||
</behaviors:NavigationViewHeaderBehavior>
|
||||
<ic:EventTriggerBehavior EventName="ItemInvoked">
|
||||
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ItemInvokedCommand}" />
|
||||
</ic:EventTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
<ScrollViewer Grid.Column="0">
|
||||
<Grid RowSpacing="32"
|
||||
Margin="{StaticResource MediumLeftRightBottomMargin}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Frame x:Name="shellFrame" />
|
||||
<Frame x:Name="shellFrame" />
|
||||
|
||||
<StackPanel x:Name="SidePanel"
|
||||
<StackPanel x:Name="SidePanel"
|
||||
Orientation="Vertical"
|
||||
HorizontalAlignment="Left"
|
||||
Width="240"
|
||||
Grid.Column="1">
|
||||
|
||||
<TextBlock Text="About this feature"
|
||||
<TextBlock x:Name="Feature_Details_Title"
|
||||
Text="About this feature"
|
||||
Style="{StaticResource SettingsGroupTitleStyle}"
|
||||
Margin="{StaticResource XSmallBottomMargin}"/>
|
||||
|
||||
<HyperlinkButton Content="Module overview"/>
|
||||
<HyperlinkButton Content="Give feedback"/>
|
||||
<ListView x:Name="Feature_Details">
|
||||
<HyperlinkButton x:Name="Module_Overview_LinkButton"
|
||||
Content="Module overview"/>
|
||||
<HyperlinkButton x:Name="Module_Feedback_LinkButton"
|
||||
Content="Give feedback"/>
|
||||
</ListView>
|
||||
|
||||
<TextBlock Text="Contributors"
|
||||
Style="{StaticResource SettingsGroupTitleStyle}"/>
|
||||
<TextBlock x:Name="Contributors_List_Title"
|
||||
Text="Contributors"
|
||||
Style="{StaticResource SettingsGroupTitleStyle}"/>
|
||||
|
||||
<HyperlinkButton Content="Contributor name"/>
|
||||
<HyperlinkButton Content="Contributor name"/>
|
||||
<HyperlinkButton Content="Contributor name"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</winui:NavigationView>
|
||||
<ListView x:Name="Contributors_List" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</winui:NavigationView>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -5,10 +5,13 @@
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.PowerToys.Settings.UI.Activation;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Settings.UI.Services;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,19 +33,12 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// <summary>
|
||||
/// A shell handler to be used to update contents of the shell dynamically from page within the frame.
|
||||
/// </summary>
|
||||
public static Microsoft.UI.Xaml.Controls.NavigationView ShellHandler = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// IPC callback function for restart elevated.
|
||||
/// </summary>
|
||||
public static IPCMessageCallback Restart_Elevated_Callback = null;
|
||||
|
||||
public static ShellPage ShellHandler = null;
|
||||
|
||||
/// <summary>
|
||||
/// IPC callback function for run on start up.
|
||||
/// </summary>
|
||||
public static IPCMessageCallback Run_OnStartUp_Callback = null;
|
||||
public static IPCMessageCallback Default_SndMSG_Callback = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShellPage"/> class.
|
||||
@@ -53,27 +49,61 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
this.InitializeComponent();
|
||||
|
||||
this.DataContext = this.ViewModel;
|
||||
ShellHandler = this.navigationView;
|
||||
ShellHandler = this;
|
||||
this.ViewModel.Initialize(this.shellFrame, this.navigationView, this.KeyboardAccelerators);
|
||||
this.shellFrame.Navigate(typeof(GeneralPage));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restart elevated callback function initialization.
|
||||
/// </summary>
|
||||
/// <param name="implmentation">delegate function implementation.</param>
|
||||
public void SetRestartElevatedCallback(IPCMessageCallback implmentation)
|
||||
{
|
||||
Restart_Elevated_Callback = implmentation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run on start up callback function elevated initialization.
|
||||
/// </summary>
|
||||
/// <param name="implmentation">delegate function implementation.</param>
|
||||
public void SetRunOnStartUpCallback(IPCMessageCallback implmentation)
|
||||
public void SetDefaultSndMessageCallback(IPCMessageCallback implmentation)
|
||||
{
|
||||
Run_OnStartUp_Callback = implmentation;
|
||||
Default_SndMSG_Callback = implmentation;
|
||||
}
|
||||
|
||||
public void HideFeatureDetails()
|
||||
{
|
||||
this.Feature_Details_Title.Visibility = Visibility.Collapsed;
|
||||
this.Feature_Details.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public void ShowFeatureDetails()
|
||||
{
|
||||
this.Feature_Details_Title.Visibility = Visibility.Visible;
|
||||
this.Feature_Details.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
public void SetFeatureDetails(string moduleOverviewLink,string reportBugLink)
|
||||
{
|
||||
this.Module_Overview_LinkButton.NavigateUri = new Uri(moduleOverviewLink);
|
||||
this.Module_Feedback_LinkButton.NavigateUri = new Uri(reportBugLink);
|
||||
}
|
||||
|
||||
public void HideContributorsList()
|
||||
{
|
||||
this.Contributors_List_Title.Visibility = Visibility.Collapsed;
|
||||
this.Contributors_List.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public void ShowContributorsList()
|
||||
{
|
||||
this.Contributors_List_Title.Visibility = Visibility.Visible;
|
||||
this.Contributors_List.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
public void PopulateContributorsList(List<Contributor> contributors)
|
||||
{
|
||||
this.Contributors_List.Items.Clear();
|
||||
|
||||
foreach (Contributor contributor in contributors)
|
||||
{
|
||||
HyperlinkButton link = new HyperlinkButton();
|
||||
link.Content = contributor.Name;
|
||||
link.NavigateUri = new Uri(contributor.Link);
|
||||
this.Contributors_List.Items.Add(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user