private static void VolumeShelf_Closed(object sender, ClosedEventArgs e) { // note that the component is thrown away when the shelf is closed by the user _volumeShelf.Closed -= VolumeShelf_Closed; _volumeShelf = null; _volumeComponent = null; }
public void Show() { if (_volumeComponent == null) { // create and initialize the layout component _volumeComponent = new VolumeComponent(this.Context.DesktopWindow); // launch the layout component in a shelf _volumeShelf = ApplicationComponent.LaunchAsShelf( this.Context.DesktopWindow, _volumeComponent, SR.TitleVolumeController, ShelfDisplayHint.DockLeft); _volumeShelf.Closed += VolumeShelf_Closed; } }