private void SetProperty(TabMode now, TabButton.Mode mode) { TabButton button = null; FrameworkElement element = null; switch (now) { case TabMode.Season: button = tabSeason; element = scrollSeason; break; case TabMode.Archive: button = tabArchive; element = scrollArchive; break; case TabMode.Notification: button = tabNotify; element = scrollNotify; break; case TabMode.Setting: button = tabSetting; element = gridSetting; break; } button.ViewMode = mode; element.IsHitTestVisible = mode == TabButton.Mode.Clickable ? false : true; Storyboard sb = new Storyboard(); sb.Children.Add(Animation.GetDoubleAnimation(mode == TabButton.Mode.Clickable ? 0 : 1, element, 0)); sb.Begin(this); }
private static void EnablePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TabButton button = obj as TabButton; button.AnimateControl((Mode)e.OldValue, (Mode)e.NewValue); }
private static void TextPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TabButton button = obj as TabButton; button.text.Text = e.NewValue.ToString(); }