diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml b/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml index 60b0c08a..a987ce4f 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml @@ -176,7 +176,7 @@ - + commandBigIcon_Executed @@ -185,7 +185,7 @@ commandList_Executed - + commandDetail_Executed @@ -283,6 +283,11 @@ + + + 1 + 2 + diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp index 53841df0..dac707c0 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp @@ -14,26 +14,44 @@ namespace demo void MainWindow::commandBigIcon_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandBigIcon->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewBigIconContentProvider); } void MainWindow::commandDetail_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandDetail->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewDetailContentProvider); } void MainWindow::commandInformation_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandInformation->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewInformationContentProvider); } void MainWindow::commandList_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandList->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewListContentProvider); } void MainWindow::commandSmallIcon_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandSmallIcon->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewSmallIconContentProvider); } void MainWindow::commandTile_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + ClearViewSelection(); + commandTile->SetSelected(true); + listViewContacts->ChangeItemStyle(new list::ListViewTileContentProvider); } void MainWindow::OnCreate() @@ -46,6 +64,16 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER + void MainWindow::ClearViewSelection() + { + commandBigIcon->SetSelected(false); + commandSmallIcon->SetSelected(false); + commandList->SetSelected(false); + commandDetail->SetSelected(false); + commandTile->SetSelected(false); + commandInformation->SetSelected(false); + } + MainWindow::MainWindow(Ptr ViewModel) { InitializeComponents(ViewModel); diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h index bfc91ab3..32d86f28 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h @@ -29,6 +29,8 @@ namespace demo void OnCreate(); void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER + + void ClearViewSelection(); public: MainWindow(Ptr ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/UIRes/AddressBook.bin b/Tutorial/GacUI_Controls/UIRes/AddressBook.bin index 59f1d21e..e4a91827 100644 Binary files a/Tutorial/GacUI_Controls/UIRes/AddressBook.bin and b/Tutorial/GacUI_Controls/UIRes/AddressBook.bin differ