static void OnArrivalChangedStatic(DependencyObject sender, DependencyPropertyChangedEventArgs e)
 {
     var typedSender = sender as RealTimeArrivalControl;
     if (e.NewValue is RealTimeArrival)
     {
         var viewModel = new RealTimeArrivalViewModel((RealTimeArrival)e.NewValue);
         typedSender.MainButton.DataContext = viewModel;
         if (viewModel.HasLongRouteName)
             VisualStateManager.GoToState(typedSender, "LongRouteNameArrivalState", true);
         if (viewModel.IsFrequencyBased)
             VisualStateManager.GoToState(typedSender, "FrequencyBasedArrivalState", true);
     }
 }
        static void OnArrivalChangedStatic(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var typedSender = sender as RealTimeArrivalControl;

            if (e.NewValue is RealTimeArrival)
            {
                var viewModel = new RealTimeArrivalViewModel((RealTimeArrival)e.NewValue);
                typedSender.MainButton.DataContext = viewModel;
                if (viewModel.HasLongRouteName)
                {
                    VisualStateManager.GoToState(typedSender, "LongRouteNameArrivalState", true);
                }
                if (viewModel.IsFrequencyBased)
                {
                    VisualStateManager.GoToState(typedSender, "FrequencyBasedArrivalState", true);
                }
            }
        }