diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml b/SubCabinetSolution/Views/RefundSpdPage.xaml new file mode 100644 index 0000000..a495985 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml b/SubCabinetSolution/Views/RefundSpdPage.xaml new file mode 100644 index 0000000..a495985 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml.cs b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs new file mode 100644 index 0000000..3091430 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class RefundSpdPage : Page + { + public RefundSpdPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml b/SubCabinetSolution/Views/RefundSpdPage.xaml new file mode 100644 index 0000000..a495985 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml.cs b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs new file mode 100644 index 0000000..3091430 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class RefundSpdPage : Page + { + public RefundSpdPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/ReturnGoodsPage.xaml b/SubCabinetSolution/Views/ReturnGoodsPage.xaml new file mode 100644 index 0000000..b15326b --- /dev/null +++ b/SubCabinetSolution/Views/ReturnGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml b/SubCabinetSolution/Views/RefundSpdPage.xaml new file mode 100644 index 0000000..a495985 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml.cs b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs new file mode 100644 index 0000000..3091430 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class RefundSpdPage : Page + { + public RefundSpdPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/ReturnGoodsPage.xaml b/SubCabinetSolution/Views/ReturnGoodsPage.xaml new file mode 100644 index 0000000..b15326b --- /dev/null +++ b/SubCabinetSolution/Views/ReturnGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs b/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs new file mode 100644 index 0000000..4aaee3b --- /dev/null +++ b/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class ReturnGoodsPage : Page + { + public ReturnGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 05cca62..19581c4 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/App.xaml b/SubCabinetSolution/App.xaml index 45fee79..8fcc52e 100644 --- a/SubCabinetSolution/App.xaml +++ b/SubCabinetSolution/App.xaml @@ -3,9 +3,9 @@ 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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:SubCabinetSolution.ViewModel" - d1p1:Ignorable="d" + d1P1:Ignorable="d" StartupUri="MainWindow.xaml"> diff --git a/SubCabinetSolution/SubCabinetSolution.csproj b/SubCabinetSolution/SubCabinetSolution.csproj index 071c84d..2601c56 100644 --- a/SubCabinetSolution/SubCabinetSolution.csproj +++ b/SubCabinetSolution/SubCabinetSolution.csproj @@ -158,16 +158,44 @@ + + + + + + + + + AdoptionPage.xaml + + + CabinetMainPage.xaml + CabinetWindow.xaml + + EmergencyPage.xaml + InquirePage.xaml + + InventoryPage.xaml + + + PutGoodsPage.xaml + + + RefundSpdPage.xaml + + + ReturnGoodsPage.xaml + MSBuild:Compile Designer @@ -180,11 +208,18 @@ MainWindow.xaml Code + + + Designer MSBuild:Compile + + + + diff --git a/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs new file mode 100644 index 0000000..08b8103 --- /dev/null +++ b/SubCabinetSolution/ViewModel/AdoptionPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class AdoptionPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs new file mode 100644 index 0000000..a64c933 --- /dev/null +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class CabinetMainPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/CabinetViewModel.cs b/SubCabinetSolution/ViewModel/CabinetViewModel.cs index 00d5e78..9ebeb4f 100644 --- a/SubCabinetSolution/ViewModel/CabinetViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetViewModel.cs @@ -128,32 +128,32 @@ this.MainTopImage = functionModel.Image; this.MainTopTitle = functionModel.Title; + INavigationService navigationService = ServiceLocator.Current.GetInstance(); switch (functionModel.Title) { case "手术单领用": - + navigationService.NavigateTo("AdoptionPage"); break; case "归还": - + navigationService.NavigateTo("ReturnGoodsPage"); break; case "紧急领用": - + navigationService.NavigateTo("EmergencyPage"); break; case "上架": - + navigationService.NavigateTo("PutGoodsPage"); break; case "盘点": - + navigationService.NavigateTo("InventoryPage"); break; case "退SPD库": - + navigationService.NavigateTo("RefundSpdPage"); break; case "查询": - INavigationService navigationService = ServiceLocator.Current.GetInstance(); navigationService.NavigateTo("InquirePage"); break; case "主页": - + navigationService.NavigateTo("CabinetMainPage"); break; } } diff --git a/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs new file mode 100644 index 0000000..efb60db --- /dev/null +++ b/SubCabinetSolution/ViewModel/EmergencyPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class EmergencyPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index cd6a750..23b0856 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -1,15 +1,12 @@ using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.Views; namespace SubCabinetSolution.ViewModel { public class InquirePageViewModel : ViewModelBase { - private INavigationService _navigationService; - - public InquirePageViewModel(INavigationService navigationService) + public InquirePageViewModel() { - this._navigationService = navigationService; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs new file mode 100644 index 0000000..c425281 --- /dev/null +++ b/SubCabinetSolution/ViewModel/InventoryPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class InventoryPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs new file mode 100644 index 0000000..b6ddd0e --- /dev/null +++ b/SubCabinetSolution/ViewModel/PutGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class PutGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs new file mode 100644 index 0000000..77800db --- /dev/null +++ b/SubCabinetSolution/ViewModel/RefundSpdPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class RefundSpdPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs new file mode 100644 index 0000000..b581078 --- /dev/null +++ b/SubCabinetSolution/ViewModel/ReturnGoodsPageViewModel.cs @@ -0,0 +1,7 @@ +namespace SubCabinetSolution.ViewModel +{ + public class ReturnGoodsPageViewModel + { + + } +} \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index a7ccd0b..c3de93a 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -26,26 +26,6 @@ /// public class ViewModelLocator { - private static ViewModelLocator _default; - private static readonly object InstanceLock = new object(); - - public static ViewModelLocator Default - { - get - { - if (_default == null) - { - lock (InstanceLock) - { - if (_default == null) - _default = new ViewModelLocator(); - } - } - - return _default; - } - } - /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -56,7 +36,14 @@ // ע��ҳ��VM SimpleIoc.Default.Register(); //��¼ҳ SimpleIoc.Default.Register(); //������ + SimpleIoc.Default.Register(); //����������Pageҳ + SimpleIoc.Default.Register(); //�黹Pageҳ + SimpleIoc.Default.Register(); //��������Pageҳ + SimpleIoc.Default.Register(); //�ϼ�Pageҳ + SimpleIoc.Default.Register(); //�̵�Pageҳ + SimpleIoc.Default.Register(); //��SPD��Pageҳ SimpleIoc.Default.Register(); //��ѯPageҳ + SimpleIoc.Default.Register(); //������Pageҳ // ע�ᵼ��Service INavigationService navigationService = this.InitNavigationService(); @@ -76,24 +63,45 @@ new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", new Uri("/SubCabinetSolution;component/Views/CabinetWindow.xaml", UriKind.Relative)); + service.Configure("AdoptionPage", + new Uri("/SubCabinetSolution;component/Views/AdoptionPage.xaml", UriKind.Relative)); + service.Configure("ReturnGoodsPage", + new Uri("/SubCabinetSolution;component/Views/ReturnGoodsPage.xaml", UriKind.Relative)); + service.Configure("EmergencyPage", + new Uri("/SubCabinetSolution;component/Views/EmergencyPage.xaml", UriKind.Relative)); + service.Configure("PutGoodsPage", + new Uri("/SubCabinetSolution;component/Views/PutGoodsPage.xaml", UriKind.Relative)); + service.Configure("InventoryPage", + new Uri("/SubCabinetSolution;component/Views/InventoryPage.xaml", UriKind.Relative)); + service.Configure("RefundSpdPage", + new Uri("/SubCabinetSolution;component/Views/RefundSpdPage.xaml", UriKind.Relative)); service.Configure("InquirePage", new Uri("/SubCabinetSolution;component/Views/InquirePage.xaml", UriKind.Relative)); + service.Configure("CabinetMainPage", + new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); return service; } - /// - /// ����Service - /// - // public INavigationService NavigationService => ServiceLocator.Current.GetInstance(); - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); + public AdoptionPageViewModel AdoptionPage => ServiceLocator.Current.GetInstance(); + + public ReturnGoodsPageViewModel ReturnGoodsPage => + ServiceLocator.Current.GetInstance(); + + public EmergencyPageViewModel EmergencyPage => ServiceLocator.Current.GetInstance(); + public PutGoodsPageViewModel PutGoodsPage => ServiceLocator.Current.GetInstance(); + public InventoryPageViewModel InventoryPage => ServiceLocator.Current.GetInstance(); + public RefundSpdPageViewModel RefundSpdPage => ServiceLocator.Current.GetInstance(); public InquirePageViewModel InquirePage => ServiceLocator.Current.GetInstance(); + public CabinetMainPageViewModel CabinetMainPage => + ServiceLocator.Current.GetInstance(); + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml b/SubCabinetSolution/Views/AdoptionPage.xaml new file mode 100644 index 0000000..a7ec821 --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/AdoptionPage.xaml.cs b/SubCabinetSolution/Views/AdoptionPage.xaml.cs new file mode 100644 index 0000000..39f880c --- /dev/null +++ b/SubCabinetSolution/Views/AdoptionPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class AdoptionPage : Page + { + public AdoptionPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml new file mode 100644 index 0000000..c68ac2d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml.cs b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs new file mode 100644 index 0000000..5b8f23d --- /dev/null +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class CabinetMainPage : Page + { + public CabinetMainPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml b/SubCabinetSolution/Views/EmergencyPage.xaml new file mode 100644 index 0000000..2fcfa51 --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/EmergencyPage.xaml.cs b/SubCabinetSolution/Views/EmergencyPage.xaml.cs new file mode 100644 index 0000000..6946c3f --- /dev/null +++ b/SubCabinetSolution/Views/EmergencyPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class EmergencyPage : Page + { + public EmergencyPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/InventoryPage.xaml b/SubCabinetSolution/Views/InventoryPage.xaml new file mode 100644 index 0000000..94ac208 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/InventoryPage.xaml.cs b/SubCabinetSolution/Views/InventoryPage.xaml.cs new file mode 100644 index 0000000..8577a28 --- /dev/null +++ b/SubCabinetSolution/Views/InventoryPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class InventoryPage : Page + { + public InventoryPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml b/SubCabinetSolution/Views/PutGoodsPage.xaml new file mode 100644 index 0000000..5c41952 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/PutGoodsPage.xaml.cs b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs new file mode 100644 index 0000000..fe974d2 --- /dev/null +++ b/SubCabinetSolution/Views/PutGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class PutGoodsPage : Page + { + public PutGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml b/SubCabinetSolution/Views/RefundSpdPage.xaml new file mode 100644 index 0000000..a495985 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/RefundSpdPage.xaml.cs b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs new file mode 100644 index 0000000..3091430 --- /dev/null +++ b/SubCabinetSolution/Views/RefundSpdPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class RefundSpdPage : Page + { + public RefundSpdPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/Views/ReturnGoodsPage.xaml b/SubCabinetSolution/Views/ReturnGoodsPage.xaml new file mode 100644 index 0000000..b15326b --- /dev/null +++ b/SubCabinetSolution/Views/ReturnGoodsPage.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs b/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs new file mode 100644 index 0000000..4aaee3b --- /dev/null +++ b/SubCabinetSolution/Views/ReturnGoodsPage.xaml.cs @@ -0,0 +1,12 @@ +using System.Windows.Controls; + +namespace SubCabinetSolution.Views +{ + public partial class ReturnGoodsPage : Page + { + public ReturnGoodsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SubCabinetSolution/obj/Debug/App.g.i.cs b/SubCabinetSolution/obj/Debug/App.g.i.cs index 3dece04..96dd186 100644 --- a/SubCabinetSolution/obj/Debug/App.g.i.cs +++ b/SubCabinetSolution/obj/Debug/App.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B7492805C652E5A95920A5961432B8FC8DE65A22AF222FA9216B25953C5A145E" +#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6244E858AE15D331C50E270641E5B514CFBAD0F3080FF98577C763E233FA2603" //------------------------------------------------------------------------------ // // 此代码由工具生成。