Beispiel #1
0
        /// <summary>
        /// Handles the Click event of the ChannelAddWrapPannel control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        void ChannelAddWrapPannel_Click(object sender, RoutedEventArgs e)
        {
            if (ChannelSetupControlPanel.Children.Count == 0)
            {
                ChannelAddControl channelAddControl = e.Source as ChannelAddControl;

                // Setup Control
                ChannelSetupControl setupControl = new ChannelSetupControl(channelAddControl.ChannelConfiguration.Clone());
                setupControl.IsInEditModus         = false;
                setupControl.HorizontalAlignment   = HorizontalAlignment.Center;
                setupControl.VerticalAlignment     = VerticalAlignment.Center;
                setupControl.OnValidationFinished += OnValidationFinishedHandler;
                setupControl.OnCancel             += OnCancelHandler;
                setupControl.RenderTransform       = new TranslateTransform(0, 0);

                ChannelSetupControlPanel.Children.Add(setupControl);

                // Play Animation
                var firstItem  = (FrameworkElement)transitionContainer.Items[0];
                var secondItem = (FrameworkElement)transitionContainer.Items[1];

                FlipTransition transition = Resources["FlipTransition"] as FlipTransition;
                transition.Rotation                      = Direction.RightToLeft;
                transitionContainer.Transition           = transition;
                transitionContainer.TransitionCompleted -= OnTransitionCompleted;
                transitionContainer.ApplyTransition(firstItem, secondItem);
            }

            OnPropertyChanged("AllChannelConfigurations");
            OnPropertyChanged("ChannelConfiguration");

            e.Handled = true;
        }
Beispiel #2
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            foreach (var channel in new ChannelLoadHelper().AvailableChannels)
            {
                // Insert each item at index 0 of the wrap panel
                ChannelAddControl control = new ChannelAddControl();

                control.ChannelConfiguration = channel;

                ChannelAddWrapPannel.Children.Insert(0, control);
            }
        }