diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-20 19:43:15 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-20 19:43:15 +0300 |
| commit | 51afc4f6a17383e91a72c2ce060e82604d43c3a8 (patch) | |
| tree | c0aa029d9864fc8f03b69716a42eda5efe65ccd5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common | |
| parent | 2ea6653199844f5607d17a8912eb7a99e2471610 (diff) | |
| download | Tango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.tar.gz Tango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.zip | |
Working on new Machine Studio DB.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
8 files changed, 114 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs new file mode 100644 index 000000000..665d6995b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Common.Controls +{ + public class LoadingPanel : ContentControl + { + + + public bool IsLoading + { + get { return (bool)GetValue(IsLoadingProperty); } + set { SetValue(IsLoadingProperty, value); } + } + public static readonly DependencyProperty IsLoadingProperty = + DependencyProperty.Register("IsLoading", typeof(bool), typeof(LoadingPanel), new PropertyMetadata(false)); + + + + static LoadingPanel() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(LoadingPanel), new FrameworkPropertyMetadata(typeof(LoadingPanel))); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs index 4203a1e8b..76cc0433c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs @@ -43,5 +43,10 @@ namespace Tango.MachineStudio.Common /// Called when the application has been started /// </summary> void OnApplicationStarted(); + + /// <summary> + /// Called when the application is ready and all modules are loaded. + /// </summary> + void OnApplicationReady(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs index 1fd72c53a..990300143 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs @@ -13,6 +13,11 @@ namespace Tango.MachineStudio.Common.Modules public interface IStudioModuleLoader { /// <summary> + /// Occurs when all modules are initialized. + /// </summary> + event EventHandler ModulesLoaded; + + /// <summary> /// Gets all loaded modules. /// </summary> ObservableCollection<IStudioModule> AllModules { get; } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 07818269b..6fcf6dd72 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -3,6 +3,7 @@ xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs index 07f02df3a..441a4ca93 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -77,5 +77,10 @@ namespace Tango.MachineStudio.Common.StudioApplication /// </summary> /// <param name="window">The window.</param> void RegisterOpenedWindow(Window window); + + /// <summary> + /// Raises the application ready event. + /// </summary> + void NotifyApplicationReady(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs index 96715dc20..36e3994ad 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs @@ -82,6 +82,14 @@ namespace Tango.MachineStudio.Common { } + + /// <summary> + /// Called when the application is ready and all modules are loaded. + /// </summary> + public virtual void OnApplicationReady() + { + + } } /// <summary> @@ -159,6 +167,14 @@ namespace Tango.MachineStudio.Common { } + + /// <summary> + /// Called when the application is ready and all modules are loaded. + /// </summary> + public virtual void OnApplicationReady() + { + + } } /// <summary> @@ -188,6 +204,14 @@ namespace Tango.MachineStudio.Common } /// <summary> + /// Called when the application is ready and all modules are loaded. + /// </summary> + public virtual void OnApplicationReady() + { + + } + + /// <summary> /// Called when another module has wants to navigate to this module with some arguments. /// </summary> /// <param name="args">The arguments.</param> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 6d6803076..fedbaf8a9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -85,6 +85,7 @@ <DependentUpon>HiveComboControl.xaml</DependentUpon> </Compile> <Compile Include="Controls\IRealTimeGraph.cs" /> + <Compile Include="Controls\LoadingPanel.cs" /> <Compile Include="Controls\RealTimeGraphMultiControl.xaml.cs"> <DependentUpon>RealTimeGraphMultiControl.xaml</DependentUpon> </Compile> @@ -163,6 +164,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Themes\Generic.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> @@ -293,7 +298,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml new file mode 100644 index 000000000..9cc398753 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml @@ -0,0 +1,31 @@ +<ResourceDictionary + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.Common.Controls"> + + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> + + <Style TargetType="{x:Type local:LoadingPanel}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:LoadingPanel}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <Grid> + <ContentPresenter Content="{TemplateBinding Content}" /> + + <Grid Background="#60FFFFFF" Visibility="{TemplateBinding IsLoading,Converter={StaticResource BooleanToVisibilityConverter}}"> + <mahApps:ProgressRing IsActive="{TemplateBinding IsLoading}" /> + </Grid> + </Grid> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> |
