Exemple #1
0
 public MainView()
 {
     _weatherView = new WeatherControlView();
     _badgesView = new BadgesControlView();
     _dateTimeView = new DateTimeControlView();
     _detailedTextView = new DetailedTextControlView();
     _musicView = new MusicControlView();
     _newsView = new NewsControlView();
     _flashlight = new Flashlight();
     /*_glance = new Glance();
     _glance.GraceTime = TimeSpan.FromSeconds(1);
     _glance.GlanceEvent += Glance_GlanceEvent;*/
     if (!DesignerProperties.IsInDesignTool)
     {
         NAPI = new NativeAPI();
         var cont = Application.Current.Host.Content;
         NAPI.InitUIXMAResources((int)Math.Ceiling(cont.ActualWidth * cont.ScaleFactor * 0.01), (int)Math.Ceiling(cont.ActualHeight * cont.ScaleFactor * 0.01));
         _secondsTimer = new DispatcherTimer();
         _secondsTimer.Interval = new TimeSpan(0, 0, 1);
         _secondsTimer.Tick += secondsTimer_Tick;
     }
     else
     {
         PopulateDesignerData();
     }
     MusicView.PropertyChanged += (object sender, PropertyChangedEventArgs e) => {
         if (e.PropertyName == "HasMusic")
         {
             RaisePropertyChanged("LowerPanelVisibility");
             RaisePropertyChanged("RightPanelRowSpan");
         }
     };
     Flashlight.PropertyChanged += (object sender, PropertyChangedEventArgs e) => {
         if (e.PropertyName == "IsTurnedOn")
         {
             RaisePropertyChanged("FlashlightImageUri");
         }
     };
 }
Exemple #2
0
        public WeatherControlView GetCopy()
        {
            WeatherControlView copy = (WeatherControlView)this.MemberwiseClone();

            return(copy);
        }