init
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1F817D85-4EC6-4300-AB35-085765B97A9A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>StatusAndProgressBar</RootNamespace>
|
||||
<AssemblyName>StatusAndProgressBar</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xaml.Behaviors">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Prism">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Unity.Wpf">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Wpf">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="Unity.Abstractions">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Container">
|
||||
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="StatusAndProgressBarModule.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ViewModel\StatusAndProgressFooterViewModel.cs" />
|
||||
<Compile Include="ViewModel\StatusAndProgressBarViewModel.cs" />
|
||||
<Compile Include="View\StatusAndProgressFooterView.xaml.cs">
|
||||
<DependentUpon>StatusAndProgressFooterView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\StatusAndProgressBarView.xaml.cs">
|
||||
<DependentUpon>StatusAndProgressBarView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Common\DTS.Common.Utilities\DTS.Common.Utilities.csproj">
|
||||
<Project>{03EACE47-EA59-44AC-B49D-956E4DC4D618}</Project>
|
||||
<Name>DTS.Common.Utilities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
|
||||
<Project>{114edc77-f3b5-4576-a91b-40818d503b55}</Project>
|
||||
<Name>DTS.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="View\StatusAndProgressFooterView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\StatusAndProgressBarView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interactivity;
|
||||
using DTS.Common.Interface;
|
||||
using Prism.Events;
|
||||
using Prism.Regions;
|
||||
using Unity;
|
||||
|
||||
namespace DTS.StatusAndProgressBar
|
||||
{
|
||||
public class StatusAndProgressFooterViewModel : BaseViewModel<IStatusAndProgressBarFooterViewModel>, IStatusAndProgressBarFooterViewModel
|
||||
{
|
||||
public IStatusAndProgressFooterView View { get; set; }
|
||||
public IBaseViewModel Parent { get; set; }
|
||||
private IEventAggregator _eventAggregator { get; set; }
|
||||
private IUnityContainer _unityContainer { get; set; }
|
||||
|
||||
public InteractionRequest<Notification> NotificationRequest { get; private set; }
|
||||
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
|
||||
/// <summary>
|
||||
/// Creates a new instance of the FilterViewModel.
|
||||
/// </summary>
|
||||
/// <param name="view">The StatusAndProgressBar View interface.</param>
|
||||
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
|
||||
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
|
||||
/// <param name="unityContainer">The Unity container.</param>
|
||||
public StatusAndProgressFooterViewModel(IStatusAndProgressFooterView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
|
||||
: base(regionManager, eventAggregator, unityContainer)
|
||||
{
|
||||
View = view;
|
||||
View.DataContext = this;
|
||||
|
||||
NotificationRequest = new InteractionRequest<Notification>();
|
||||
ConfirmationRequest = new InteractionRequest<Confirmation>();
|
||||
|
||||
_eventAggregator = eventAggregator;
|
||||
_unityContainer = unityContainer;
|
||||
_eventAggregator.GetEvent<ProgressBarEvent>().Subscribe(OnStatusAndProgressBarEvent);
|
||||
}
|
||||
|
||||
#region Properties
|
||||
public new bool IsMenuIncluded { get; set; }
|
||||
public new bool IsNavigationIncluded { get; set; }
|
||||
public new bool IsBusy { get; set; }
|
||||
public new bool IsDirty { get; }
|
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged;
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
private new void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
public string ProgressText { get; set; }
|
||||
public Visibility ProgressBarVisiblity { get; set; }
|
||||
public int ProgressBarValue { get; set; }
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
private void SetProgressText(string value)
|
||||
{
|
||||
ProgressText = value;
|
||||
OnPropertyChanged("ProgressText");
|
||||
}
|
||||
|
||||
private void SetProgressBarVisibility(Visibility visibility)
|
||||
{
|
||||
ProgressBarVisiblity = visibility;
|
||||
OnPropertyChanged("ProgressBarVisibility");
|
||||
}
|
||||
|
||||
private void SetProgressBarValue(int value)
|
||||
{
|
||||
ProgressBarValue = value;
|
||||
OnPropertyChanged("ProgressBarValue");
|
||||
}
|
||||
private void OnStatusAndProgressBarEvent(ProgressBarEventArg args)
|
||||
{
|
||||
if (args.ProgressBarName != "Footer") { return; }
|
||||
|
||||
if (args.SetPercentage)
|
||||
{
|
||||
SetProgressBarValue(Convert.ToInt32(args.ProgressBarPercentage));
|
||||
}
|
||||
|
||||
if (args.SetText)
|
||||
{
|
||||
SetProgressText(args.ProgressBarText);
|
||||
}
|
||||
|
||||
if (args.SetVisibility)
|
||||
{
|
||||
SetProgressBarVisibility(args.ProgressBarVisibility);
|
||||
}
|
||||
}
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user