Esempio n. 1
0
        public static IEnumerable<LayerViewModel> CreateLayers(IList<ChannelViewModel> channels)
        {
            LayerViewModel layerViewModel = new LayerViewModel { ItemId = 1, Title = "Ch 1-8", IsActive = true };
            for (int i = 0; i < 8; i++)
                layerViewModel.Channels.Add(channels[i]);
            AddAllChannelsToLayer(layerViewModel, channels);
            yield return layerViewModel;

            layerViewModel = new LayerViewModel { ItemId = 2, Title = "Ch 9-16" };
            for (int i = 8; i < 16; i++)
                layerViewModel.Channels.Add(channels[i]);
            AddAllChannelsToLayer(layerViewModel, channels);
            yield return layerViewModel;

            layerViewModel = new LayerViewModel { ItemId = 3, Title = "Aux / Fx" };
            for (int i = 16; i < 21; i++)
                layerViewModel.Channels.Add(channels[i]);
            AddAllChannelsToLayer(layerViewModel, channels);
            yield return layerViewModel;

            layerViewModel = new LayerViewModel { ItemId = 4, Title = "Bus" };
            for (int i = 21; i < 27; i++)
                layerViewModel.Channels.Add(channels[i]);
            AddAllChannelsToLayer(layerViewModel, channels);
            yield return layerViewModel;

            layerViewModel = new LayerViewModel { ItemId = 5, Title = "FxSend / Main" };
            for (int i = 27; i < 32; i++)
                layerViewModel.Channels.Add(channels[i]);
            AddAllChannelsToLayer(layerViewModel, channels);
            yield return layerViewModel;
        }
Esempio n. 2
0
 private static void AddAllChannelsToLayer(LayerViewModel layerViewModel, IList<ChannelViewModel> channels)
 {
     foreach (var channel in channels)
     {
         LayerChannelViewModel layerChannel = new LayerChannelViewModel();
         layerChannel.IsAssigned = layerViewModel.Channels.Contains(channel);
         layerChannel.Channel = channel;
         layerChannel.Layer = layerViewModel;
         layerViewModel.AllChannels.Add(layerChannel);
     }
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.Parameter != null)
            {
                // Parameter is item ID
                var id = (int)e.Parameter;
                _lastSelectedItem = XAirConnectionController.Instance.Application.Layers.Where((item) => item.ItemId == id).FirstOrDefault();
            }

            UpdateForVisualState(AdaptiveStates.CurrentState);

            DisableContentTransitions();
        }
        private void MasterListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var clickedItem = (LayerViewModel)e.ClickedItem;
            _lastSelectedItem = clickedItem;

            if (AdaptiveStates.CurrentState == NarrowState)
                LayerConfigurationFrame.Navigate(typeof(LayerDetail), clickedItem.ItemId, new DrillInNavigationTransitionInfo());
            else
                EnableContentTransitions();
        }