Adjust project structure
This commit is contained in:
1 parent
d38912f5da
commit
e3c436f939
2111 files changed
+14028
-47199
No files matched your search
@@ -0,0 +1,377 @@
|
||||
<?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>{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>HandyControlDemo</RootNamespace>
|
||||
<AssemblyName>HandyControlDemo</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MvvmLightLibs">
|
||||
<Version>5.4.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>11.0.2</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
|
||||
<DependentUpon>NoUserContent.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
||||
<Compile Include="ViewModel\Basic\InteractiveDialogViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\BadgeDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\DialogDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\ImageBrowserDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\NotifyIconDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\PaginationDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\SearchBarDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\StepBarDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\Controls\WindowDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
|
||||
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
||||
<Compile Include="ViewModel\Main\MainViewModel.cs" />
|
||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="UserControl\Main\NoUserContent.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\1.jpg">
|
||||
<Link>Resources\Img\1.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\2.jpg">
|
||||
<Link>Resources\Img\2.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\3.jpg">
|
||||
<Link>Resources\Img\3.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\4.jpg">
|
||||
<Link>Resources\Img\4.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\5.jpg">
|
||||
<Link>Resources\Img\5.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\1.jpg">
|
||||
<Link>Resources\Img\Album\1.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\10.jpg">
|
||||
<Link>Resources\Img\Album\10.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\2.jpg">
|
||||
<Link>Resources\Img\Album\2.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\3.jpg">
|
||||
<Link>Resources\Img\Album\3.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\4.jpg">
|
||||
<Link>Resources\Img\Album\4.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\5.jpg">
|
||||
<Link>Resources\Img\Album\5.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\6.jpg">
|
||||
<Link>Resources\Img\Album\6.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\7.jpg">
|
||||
<Link>Resources\Img\Album\7.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\8.jpg">
|
||||
<Link>Resources\Img\Album\8.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Album\9.jpg">
|
||||
<Link>Resources\Img\Album\9.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar1.png">
|
||||
<Link>Resources\Img\Avatar\avatar1.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar2.png">
|
||||
<Link>Resources\Img\Avatar\avatar2.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar3.png">
|
||||
<Link>Resources\Img\Avatar\avatar3.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar4.png">
|
||||
<Link>Resources\Img\Avatar\avatar4.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar5.png">
|
||||
<Link>Resources\Img\Avatar\avatar5.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Avatar\avatar6.png">
|
||||
<Link>Resources\Img\Avatar\avatar6.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\b1.jpg">
|
||||
<Link>Resources\Img\b1.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\b2.jpg">
|
||||
<Link>Resources\Img\b2.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\car_chase.gif">
|
||||
<Link>Resources\Img\car_chase.gif</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Chat\chat_back1.jpg">
|
||||
<Link>Resources\Img\Chat\chat_back1.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Chat\chat_back2.jpg">
|
||||
<Link>Resources\Img\Chat\chat_back2.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\cn.png">
|
||||
<Link>Resources\Img\Flag\cn.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Flag\en.png">
|
||||
<Link>Resources\Img\Flag\en.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon-white.ico">
|
||||
<Link>Resources\Img\icon-white.ico</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico">
|
||||
<Link>Resources\Img\icon.ico</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Animation_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Animation_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\BorderElement_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\BorderElement_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Brush_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Brush_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Bubble_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\Bubble_16xLG.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonClick_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ButtonClick_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Calendar_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Calendar_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Carousel_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Carousel_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\CheckBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\CheckBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ColorPalette_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ColorPalette_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ColorWheel_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ColorWheel_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ComboBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ComboBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ContextMenu_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ContextMenu_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DataGrid_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\DataGrid_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DatePicker_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\DatePicker_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DetailDataView_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\DetailDataView_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Dialog_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Dialog_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\DotLarge_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\DotLarge_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Expander_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Expander_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\FlipVertical_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\FlipVertical_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Flow_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Flow_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\GoToTop_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\GoToTop_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\GroupBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\GroupBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\HoverMenu_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\HoverMenu_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageBrowser_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageBrowser_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Label_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Label_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\LinearCarousel_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\LinearCarousel_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ListBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ListBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ListView_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ListView_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Loading_Blue_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Loading_Blue_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Message_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Message_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\NotificationHub_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\NotificationHub_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\NumericListBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\NumericListBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Paginator_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Paginator_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Panel_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Panel_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\PasswordBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\PasswordBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Path_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Path_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ProgressBar_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ProgressBar_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ProgressButton_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ProgressButton_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\RadioButton_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\RadioButton_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\RichTextBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\RichTextBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ScrollBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ScrollBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Search_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Search_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Shield_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Shield_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Slider_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Slider_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\SortAscending_grey_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\SortAscending_grey_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\SplitterControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\SplitterControl_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Star.png">
|
||||
<Link>Resources\Img\LeftMainContent\Star.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TabPage_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\TabPage_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Tag_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Tag_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TextBlock_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\TextBlock_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TextBox_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\TextBox_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Timeline_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Timeline_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TimePicker_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\TimePicker_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Time_color_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Time_color_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Toggle_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Toggle_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ToolBar_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ToolBar_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Transfer_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\Transfer_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TreeView_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\TreeView_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\User_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\User_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\WindowsForm_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\WindowsForm_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\qq-group.jpg">
|
||||
<Link>Resources\Img\qq-group.jpg</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\under_construction.gif">
|
||||
<Link>Resources\Img\under_construction.gif</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HandyControl_Net_40\HandyControl_Net_40.csproj">
|
||||
<Project>{32204503-2ef0-4681-ae13-aa1feb6c658a}</Project>
|
||||
<Name>HandyControl_Net_40</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,99 @@
|
||||
<Grid x:Class="HandyControlDemo.UserControl.NoUserContent"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Height="29"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:enum="clr-namespace:HandyControl.Data;assembly=HandyControl"
|
||||
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
|
||||
<Button Margin="4,0,0,0" Width="28" Height="29" Style="{StaticResource ButtonCustom}">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="Click">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static shell:SystemCommands.ShowSystemMenuCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static shell:SystemCommands.CloseWindowCommand}" />
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<Path Height="16" Fill="White" Stretch="Uniform" Data="{StaticResource LogoGeometry}"/>
|
||||
</Button>
|
||||
<Menu MenuItem.Click="MenuItemLinks_OnClick" Margin="10,0,0,0" Background="Transparent">
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.Repository}">
|
||||
<MenuItem Tag="https://github.com/NaBian/HandyControl" Header="GitHub">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Tag="https://www.nuget.org/packages/HandyControl" Header="NuGet">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Foreground="White" Header="{x:Static langs:Lang.About}">
|
||||
<MenuItem Click="MenuItemQQGroup_OnClick" Header="{x:Static langs:Lang.QQGroup}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource QqGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Tag="mailto:836904362@qq.com" Header="{x:Static langs:Lang.Email}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource EmailGeometry}" Fill="{DynamicResource WarningBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Tag="https://gitter.im/HandyControl/Lobby" Header="{x:Static langs:Lang.Chatroom}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource GitterGeometry}" Fill="#e52e64"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Tag="https://www.cnblogs.com/nabian" Header="{x:Static langs:Lang.Blog}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static langs:Lang.About}" Click="MenuAbout_OnClick">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Click="MenuItemContributors_OnClick" Foreground="White" Header="{x:Static langs:Lang.Contributors}">
|
||||
<MenuItem.Icon>
|
||||
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
|
||||
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-25" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
|
||||
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,10,0,10">
|
||||
<Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
|
||||
</Button>
|
||||
<Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/en.png"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Button.Click="ButtonSkins_OnClick" Margin="10,10,10,10">
|
||||
<Button Tag="{x:Static enum:SkinType.Default}" Style="{StaticResource ButtonCustom}">
|
||||
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static enum:SkinType.Dark}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
<Button Tag="{x:Static enum:SkinType.Violet}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
|
||||
<Border Background="DarkViolet" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
@@ -0,0 +1,84 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class NoUserContent
|
||||
{
|
||||
public NoUserContent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is string tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Lang)) return;
|
||||
Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
|
||||
{
|
||||
if (!b) return true;
|
||||
GlobalData.Config.Lang = tag;
|
||||
GlobalData.Save();
|
||||
Process.Start(Process.GetCurrentProcess().MainModule.FileName);
|
||||
Application.Current.Shutdown();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
|
||||
|
||||
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is SkinType tag)
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (tag.Equals(GlobalData.Config.Skin)) return;
|
||||
GlobalData.Config.Skin = tag;
|
||||
GlobalData.Save();
|
||||
((App)Application.Current).UpdateSkin(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuItemLinks_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is MenuItem menuItem && menuItem.Tag is string tag)
|
||||
{
|
||||
Process.Start(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuItemQQGroup_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.QQGroupView}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
|
||||
private void MenuItemContributors_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.ContributorsView}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
|
||||
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new AboutWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Media;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Imaging;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ChatBoxViewModel : ViewModelBase
|
||||
{
|
||||
private static readonly string AudioCachePath = $"{AppDomain.CurrentDomain.BaseDirectory}Cache";
|
||||
|
||||
private readonly string _id = Guid.NewGuid().ToString();
|
||||
|
||||
private readonly Stopwatch _stopwatch = new Lazy<Stopwatch>(() => new Stopwatch()).Value;
|
||||
|
||||
public ChatBoxViewModel()
|
||||
{
|
||||
Messenger.Default.Register<ChatInfoModel>(this, MessageToken.SendChatMessage, ReceiveMessage);
|
||||
}
|
||||
|
||||
private void ReceiveMessage(ChatInfoModel info)
|
||||
{
|
||||
if (_id.Equals(info.SenderId)) return;
|
||||
info.Role = ChatRoleType.Receiver;
|
||||
ChatInfos.Add(info);
|
||||
}
|
||||
|
||||
private string _chatString;
|
||||
|
||||
public string ChatString
|
||||
{
|
||||
get => _chatString;
|
||||
set => Set(nameof(ChatString), ref _chatString, value);
|
||||
}
|
||||
|
||||
public ObservableCollection<ChatInfoModel> ChatInfos { get; set; } = new ObservableCollection<ChatInfoModel>();
|
||||
|
||||
public RelayCommand<KeyEventArgs> SendStringCmd => new Lazy<RelayCommand<KeyEventArgs>>(() =>
|
||||
new RelayCommand<KeyEventArgs>(SendString)).Value;
|
||||
|
||||
private void SendString(KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ChatString)) return;
|
||||
var info = new ChatInfoModel
|
||||
{
|
||||
Message = ChatString,
|
||||
SenderId = _id,
|
||||
Type = ChatMessageType.String,
|
||||
Role = ChatRoleType.Sender
|
||||
};
|
||||
ChatInfos.Add(info);
|
||||
Messenger.Default.Send(info, MessageToken.SendChatMessage);
|
||||
ChatString = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public RelayCommand<RoutedEventArgs> ReadMessageCmd => new Lazy<RelayCommand<RoutedEventArgs>>(() =>
|
||||
new RelayCommand<RoutedEventArgs>(ReadMessage)).Value;
|
||||
|
||||
private void ReadMessage(RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is FrameworkElement element && element.Tag is ChatInfoModel info)
|
||||
{
|
||||
if (info.Type == ChatMessageType.Image)
|
||||
{
|
||||
new ImageBrowser(new Uri(info.Enclosure.ToString()))
|
||||
{
|
||||
Owner = VisualHelper.GetActiveWindow()
|
||||
}.Show();
|
||||
}
|
||||
else if (info.Type == ChatMessageType.Audio)
|
||||
{
|
||||
var player = new SoundPlayer(info.Enclosure.ToString());
|
||||
player.PlaySync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RelayCommand StartRecordCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(StartRecord)).Value;
|
||||
|
||||
private void StartRecord()
|
||||
{
|
||||
ExternDllHelper.MciSendString("set wave bitpersample 8", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave samplespersec 20000", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave channels 2", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("set wave format tag pcm", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("open new type WAVEAudio alias movie", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("record movie", "", 0, 0);
|
||||
|
||||
_stopwatch.Reset();
|
||||
_stopwatch.Start();
|
||||
}
|
||||
|
||||
public RelayCommand StopRecordCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(StopRecord)).Value;
|
||||
|
||||
private void StopRecord()
|
||||
{
|
||||
if (!Directory.Exists(AudioCachePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(AudioCachePath);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Growl.Error(e.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var cachePath = $"{AudioCachePath}\\{Guid.NewGuid().ToString()}";
|
||||
ExternDllHelper.MciSendString("stop movie", "", 0, 0);
|
||||
ExternDllHelper.MciSendString($"save movie {cachePath}", "", 0, 0);
|
||||
ExternDllHelper.MciSendString("close movie", "", 0, 0);
|
||||
|
||||
_stopwatch.Stop();
|
||||
|
||||
var info = new ChatInfoModel
|
||||
{
|
||||
Message = $"{_stopwatch.Elapsed.Seconds.ToString()} {Properties.Langs.Lang.Second}",
|
||||
SenderId = _id,
|
||||
Type = ChatMessageType.Audio,
|
||||
Role = ChatRoleType.Sender,
|
||||
Enclosure = cachePath
|
||||
};
|
||||
ChatInfos.Add(info);
|
||||
Messenger.Default.Send(info, MessageToken.SendChatMessage);
|
||||
}
|
||||
|
||||
public RelayCommand OpenImageCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(OpenImage)).Value;
|
||||
|
||||
private void OpenImage()
|
||||
{
|
||||
var dialog = new OpenFileDialog();
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
var fileName = dialog.FileName;
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
var info = new ChatInfoModel
|
||||
{
|
||||
Message = BitmapFrame.Create(new Uri(fileName)),
|
||||
SenderId = _id,
|
||||
Type = ChatMessageType.Image,
|
||||
Role = ChatRoleType.Sender,
|
||||
Enclosure = fileName
|
||||
};
|
||||
ChatInfos.Add(info);
|
||||
Messenger.Default.Send(info, MessageToken.SendChatMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControlDemo.ViewModel.Basic
|
||||
{
|
||||
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
|
||||
{
|
||||
public Action CloseAction { get; set; }
|
||||
|
||||
private string _result;
|
||||
|
||||
public string Result
|
||||
{
|
||||
get => _result;
|
||||
set => Set(nameof(Result), ref _result, value);
|
||||
}
|
||||
|
||||
private string _message;
|
||||
|
||||
public string Message
|
||||
{
|
||||
get => _message;
|
||||
set => Set(nameof(Message), ref _message, value);
|
||||
}
|
||||
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
|
||||
namespace HandyControlDemo.ViewModel.Controls
|
||||
{
|
||||
public class BadgeDemoViewModel : ViewModelBase
|
||||
{
|
||||
private int _count = 1;
|
||||
|
||||
public int Count
|
||||
{
|
||||
get => _count;
|
||||
set => Set(nameof(Count), ref _count, value);
|
||||
}
|
||||
|
||||
public RelayCommand CountCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Count++)).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools.Extension;
|
||||
using HandyControlDemo.UserControl;
|
||||
using HandyControlDemo.UserControl.Basic;
|
||||
using HandyControlDemo.ViewModel.Basic;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class DialogDemoViewModel : ViewModelBase
|
||||
{
|
||||
private string _dialogResult;
|
||||
|
||||
public string DialogResult
|
||||
{
|
||||
get => _dialogResult;
|
||||
set => Set(nameof(DialogResult), ref _dialogResult, value);
|
||||
}
|
||||
|
||||
public RelayCommand ShowTextCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(ShowText)).Value;
|
||||
|
||||
private void ShowText()
|
||||
{
|
||||
Dialog.Show(new TextDialog());
|
||||
}
|
||||
|
||||
public RelayCommand ShowInteractiveDialogCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(ShowInteractiveDialog)).Value;
|
||||
|
||||
private void ShowInteractiveDialog()
|
||||
{
|
||||
Dialog.Show<InteractiveDialog>()
|
||||
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
|
||||
.GetResultAsync<string>().ContinueWith(str => DialogResult = str.Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class GrowlDemoViewModel
|
||||
{
|
||||
private readonly string _token;
|
||||
|
||||
public GrowlDemoViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GrowlDemoViewModel(string token)
|
||||
{
|
||||
_token = token;
|
||||
}
|
||||
|
||||
public RelayCommand InfoCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Info(Properties.Langs.Lang.GrowlInfo, _token))).Value;
|
||||
|
||||
public RelayCommand SuccessCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Success(Properties.Langs.Lang.GrowlSuccess, _token))).Value;
|
||||
|
||||
public RelayCommand WarningCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Warning(new GrowlInfo
|
||||
{
|
||||
Message = Properties.Langs.Lang.GrowlWarning,
|
||||
CancelStr = Properties.Langs.Lang.Ignore,
|
||||
ActionBeforeClose = isConfirmed =>
|
||||
{
|
||||
Growl.Info(isConfirmed.ToString());
|
||||
return true;
|
||||
},
|
||||
Token = _token
|
||||
}))).Value;
|
||||
|
||||
public RelayCommand ErrorCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Error(Properties.Langs.Lang.GrowlError, _token))).Value;
|
||||
|
||||
public RelayCommand AskCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Ask(Properties.Langs.Lang.GrowlAsk, isConfirmed =>
|
||||
{
|
||||
Growl.Info(isConfirmed.ToString());
|
||||
return true;
|
||||
}, _token))).Value;
|
||||
|
||||
public RelayCommand FatalCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Fatal(new GrowlInfo
|
||||
{
|
||||
Message = Properties.Langs.Lang.GrowlFatal,
|
||||
ShowDateTime = false,
|
||||
Token = _token
|
||||
}))).Value;
|
||||
|
||||
public RelayCommand ClearCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => Growl.Clear())).Value;
|
||||
|
||||
public RelayCommand NewWindowCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => new GrowlDemoWindow().Show())).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ImageBrowserDemoViewModel
|
||||
{
|
||||
public RelayCommand OpenImgCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() =>
|
||||
new ImageBrowser(new Uri("pack://application:,,,/Resources/Img/1.jpg")).Show())).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class NotifyIconDemoViewModel : ViewModelBase
|
||||
{
|
||||
private bool _contextMenuIsShow;
|
||||
|
||||
public bool ContextMenuIsShow
|
||||
{
|
||||
get => _contextMenuIsShow;
|
||||
set
|
||||
{
|
||||
Set(nameof(ContextMenuIsShow), ref _contextMenuIsShow, value);
|
||||
GlobalData.NotifyIconIsShow = ContextMenuIsShow || ContextContentIsShow;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _contextMenuIsBlink;
|
||||
|
||||
public bool ContextMenuIsBlink
|
||||
{
|
||||
get => _contextMenuIsBlink;
|
||||
set => Set(nameof(ContextMenuIsBlink), ref _contextMenuIsBlink, value);
|
||||
}
|
||||
|
||||
private bool _contextContentIsShow;
|
||||
|
||||
public bool ContextContentIsShow
|
||||
{
|
||||
get => _contextContentIsShow;
|
||||
set
|
||||
{
|
||||
Set(nameof(ContextContentIsShow), ref _contextContentIsShow, value);
|
||||
GlobalData.NotifyIconIsShow = ContextMenuIsShow || ContextContentIsShow;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _contextContentIsBlink;
|
||||
|
||||
public bool ContextContentIsBlink
|
||||
{
|
||||
get => _contextContentIsBlink;
|
||||
set => Set(nameof(ContextContentIsBlink), ref _contextContentIsBlink, value);
|
||||
}
|
||||
|
||||
public RelayCommand<object> MouseCmd => new Lazy<RelayCommand<object>>(() =>
|
||||
new RelayCommand<object>(str=> Growl.Info(str.ToString()))).Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Data;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class PaginationDemoViewModel : DemoViewModelBase<DemoDataModel>
|
||||
{
|
||||
/// <summary>
|
||||
/// 所有数据
|
||||
/// </summary>
|
||||
private readonly List<DemoDataModel> _totalDataList;
|
||||
|
||||
/// <summary>
|
||||
/// 页码
|
||||
/// </summary>
|
||||
private int _pageIndex = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 页码
|
||||
/// </summary>
|
||||
public int PageIndex
|
||||
{
|
||||
get => _pageIndex;
|
||||
set => Set(nameof(PageIndex), ref _pageIndex, value);
|
||||
}
|
||||
|
||||
public PaginationDemoViewModel(DataService dataService)
|
||||
{
|
||||
_totalDataList = dataService.GetDemoDataList(100);
|
||||
DataList = _totalDataList.Take(10).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 页码改变命令
|
||||
/// </summary>
|
||||
public RelayCommand<FunctionEventArgs<int>> PageUpdatedCmd =>
|
||||
new Lazy<RelayCommand<FunctionEventArgs<int>>>(() =>
|
||||
new RelayCommand<FunctionEventArgs<int>>(PageUpdated)).Value;
|
||||
|
||||
/// <summary>
|
||||
/// 页码改变
|
||||
/// </summary>
|
||||
private void PageUpdated(FunctionEventArgs<int> info)
|
||||
{
|
||||
DataList = _totalDataList.Skip((info.Info - 1) * 10).Take(10).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class SearchBarDemoViewModel : ViewModelBase
|
||||
{
|
||||
public RelayCommand<string> SearchCmd => new Lazy<RelayCommand<string>>(() =>
|
||||
new RelayCommand<string>(Search)).Value;
|
||||
|
||||
private void Search(string key)
|
||||
{
|
||||
Growl.Info(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControl.Controls;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class StepBarDemoViewModel : DemoViewModelBase<StepBarDemoModel>
|
||||
{
|
||||
public StepBarDemoViewModel(DataService dataService) => DataList = dataService.GetStepBarDemoDataList();
|
||||
|
||||
/// <summary>
|
||||
/// 下一步
|
||||
/// </summary>
|
||||
public RelayCommand<Panel> NextCmd => new Lazy<RelayCommand<Panel>>(() => new RelayCommand<Panel>(Next)).Value;
|
||||
|
||||
/// <summary>
|
||||
/// 上一步
|
||||
/// </summary>
|
||||
public RelayCommand<Panel> PrevCmd => new Lazy<RelayCommand<Panel>>(() => new RelayCommand<Panel>(Prev)).Value;
|
||||
|
||||
private void Next(Panel panel)
|
||||
{
|
||||
foreach (var stepBar in panel.Children.OfType<StepBar>())
|
||||
{
|
||||
stepBar.Next();
|
||||
}
|
||||
}
|
||||
|
||||
private void Prev(Panel panel)
|
||||
{
|
||||
foreach (var stepBar in panel.Children.OfType<StepBar>())
|
||||
{
|
||||
stepBar.Prev();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using HandyControlDemo.Tools;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class WindowDemoViewModel
|
||||
{
|
||||
public RelayCommand<string> OpenWindowCmd => new Lazy<RelayCommand<string>>(() => new RelayCommand<string>(OpenWindow)).Value;
|
||||
|
||||
private void OpenWindow(string windowTag)
|
||||
{
|
||||
if (AssemblyHelper.CreateInternalInstance($"Window.{windowTag}") is System.Windows.Window window)
|
||||
{
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using GalaSoft.MvvmLight;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class DemoViewModelBase<T> : ViewModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
private IList<T> _dataList;
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
public IList<T> DataList
|
||||
{
|
||||
get => _dataList;
|
||||
set => Set(nameof(DataList), ref _dataList, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Threading.Tasks;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ContributorsViewModel : DemoViewModelBase<ContributorModel>
|
||||
{
|
||||
public ContributorsViewModel(DataService dataService)
|
||||
{
|
||||
Task.Factory.StartNew(() => DataList = dataService.GetContributorDataList());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
using HandyControlDemo.Tools;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class MainViewModel : DemoViewModelBase<DemoDataModel>
|
||||
{
|
||||
#region 字段
|
||||
|
||||
/// <summary>
|
||||
/// 内容标题
|
||||
/// </summary>
|
||||
private object _contentTitle;
|
||||
|
||||
/// <summary>
|
||||
/// 子内容
|
||||
/// </summary>
|
||||
private object _subContent;
|
||||
|
||||
/// <summary>
|
||||
/// 当前选中的列表项
|
||||
/// </summary>
|
||||
private ListBoxItem _listBoxItemCurrent;
|
||||
|
||||
#endregion
|
||||
|
||||
public MainViewModel(DataService dataService)
|
||||
{
|
||||
Messenger.Default.Register<object>(this, MessageToken.LoadShowContent, obj =>
|
||||
{
|
||||
if (SubContent is IDisposable disposable)
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
SubContent = obj;
|
||||
});
|
||||
Messenger.Default.Register<object>(this, MessageToken.ClearLeftSelected, obj =>
|
||||
{
|
||||
if (_listBoxItemCurrent == null) return;
|
||||
_listBoxItemCurrent.IsSelected = false;
|
||||
_listBoxItemCurrent = null;
|
||||
});
|
||||
DataList = dataService.GetDemoDataList();
|
||||
}
|
||||
|
||||
#region 属性
|
||||
|
||||
/// <summary>
|
||||
/// 子内容
|
||||
/// </summary>
|
||||
public object SubContent
|
||||
{
|
||||
get => _subContent;
|
||||
set => Set(nameof(SubContent), ref _subContent, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容标题
|
||||
/// </summary>
|
||||
public object ContentTitle
|
||||
{
|
||||
get => _contentTitle;
|
||||
set => Set(nameof(ContentTitle), ref _contentTitle, value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 命令
|
||||
|
||||
/// <summary>
|
||||
/// 切换例子命令
|
||||
/// </summary>
|
||||
public RelayCommand<SelectionChangedEventArgs> SwitchDemoCmd =>
|
||||
new Lazy<RelayCommand<SelectionChangedEventArgs>>(() =>
|
||||
new RelayCommand<SelectionChangedEventArgs>(SwitchDemo)).Value;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 方法
|
||||
|
||||
/// <summary>
|
||||
/// 切换例子
|
||||
/// </summary>
|
||||
private void SwitchDemo(SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count == 0) return;
|
||||
if (e.AddedItems[0] is ListBoxItem item)
|
||||
{
|
||||
if (item.Tag is string tag)
|
||||
{
|
||||
if (Equals(_listBoxItemCurrent, item)) return;
|
||||
_listBoxItemCurrent = item;
|
||||
ContentTitle = item.Content;
|
||||
Messenger.Default.Send(false, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{tag}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
else
|
||||
{
|
||||
_listBoxItemCurrent = null;
|
||||
ContentTitle = null;
|
||||
SubContent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using CommonServiceLocator;
|
||||
using GalaSoft.MvvmLight.Ioc;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
using HandyControlDemo.ViewModel.Basic;
|
||||
using HandyControlDemo.ViewModel.Controls;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ViewModelLocator
|
||||
{
|
||||
public ViewModelLocator()
|
||||
{
|
||||
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
|
||||
|
||||
SimpleIoc.Default.Register<DataService>();
|
||||
|
||||
SimpleIoc.Default.Register<MainViewModel>();
|
||||
SimpleIoc.Default.Register(() => new GrowlDemoViewModel(), "GrowlDemo");
|
||||
SimpleIoc.Default.Register(() => new GrowlDemoViewModel(MessageToken.GrowlDemoPanel), "GrowlDemoWithToken");
|
||||
SimpleIoc.Default.Register<ImageBrowserDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ComboBoxDemoViewModel>();
|
||||
SimpleIoc.Default.Register<WindowDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ContributorsViewModel>();
|
||||
SimpleIoc.Default.Register<StepBarDemoViewModel>();
|
||||
SimpleIoc.Default.Register<PaginationDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ChatBoxViewModel>();
|
||||
SimpleIoc.Default.Register<CoverViewModel>();
|
||||
SimpleIoc.Default.Register<DialogDemoViewModel>();
|
||||
SimpleIoc.Default.Register<SearchBarDemoViewModel>();
|
||||
SimpleIoc.Default.Register<NotifyIconDemoViewModel>();
|
||||
SimpleIoc.Default.Register<InteractiveDialogViewModel>();
|
||||
SimpleIoc.Default.Register<BadgeDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
Application.Current.TryFindResource("Locator") as ViewModelLocator).Value;
|
||||
|
||||
#region Vm
|
||||
|
||||
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
|
||||
|
||||
public GrowlDemoViewModel GrowlDemo => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemo");
|
||||
|
||||
public GrowlDemoViewModel GrowlDemoWithToken => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemoWithToken");
|
||||
|
||||
public ImageBrowserDemoViewModel ImageBrowserDemo => ServiceLocator.Current.GetInstance<ImageBrowserDemoViewModel>();
|
||||
|
||||
public ComboBoxDemoViewModel ComboBoxDemo => ServiceLocator.Current.GetInstance<ComboBoxDemoViewModel>();
|
||||
|
||||
public WindowDemoViewModel WindowDemo => ServiceLocator.Current.GetInstance<WindowDemoViewModel>();
|
||||
|
||||
public ContributorsViewModel ContributorsView => ServiceLocator.Current.GetInstance<ContributorsViewModel>();
|
||||
|
||||
public StepBarDemoViewModel StepBarDemo => ServiceLocator.Current.GetInstance<StepBarDemoViewModel>();
|
||||
|
||||
public PaginationDemoViewModel PaginationDemo => ServiceLocator.Current.GetInstance<PaginationDemoViewModel>();
|
||||
|
||||
public ChatBoxViewModel ChatBox => new ChatBoxViewModel();
|
||||
|
||||
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
|
||||
|
||||
public DialogDemoViewModel DialogDemo => ServiceLocator.Current.GetInstance<DialogDemoViewModel>();
|
||||
|
||||
public SearchBarDemoViewModel SearchBarDemo => ServiceLocator.Current.GetInstance<SearchBarDemoViewModel>();
|
||||
|
||||
public NotifyIconDemoViewModel NotifyIconDemo => ServiceLocator.Current.GetInstance<NotifyIconDemoViewModel>();
|
||||
|
||||
public InteractiveDialogViewModel InteractiveDialog => ServiceLocator.Current.GetInstance<InteractiveDialogViewModel>();
|
||||
|
||||
public BadgeDemoViewModel BadgeDemo => ServiceLocator.Current.GetInstance<BadgeDemoViewModel>();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user