public RepoDetailView() { this.InitializeComponent(); ViewModel = new RepoDetailViewmodel(); this.DataContext = ViewModel; // Adjust the UI to make sure the text is readable Messenger.Default.Register <GlobalHelper.SetBlurredAvatarUIBrightnessMessageType>(this, b => { if (Application.Current.RequestedTheme == ApplicationTheme.Light && b.Brightness <= 80) { byte delta = (byte)(128 - b.Brightness + 24); Color color = Color.FromArgb(byte.MaxValue, delta, delta, delta); SolidColorBrush brush = new SolidColorBrush(color); RepoName.Foreground = brush; ProfileLinkBlock.Foreground = brush; FavoriteIcon.Foreground = brush; FavoriteBlock.Foreground = brush; BranchPath.Fill = brush; BranchBlock.Foreground = brush; } else if (Application.Current.RequestedTheme == ApplicationTheme.Dark && b.Brightness >= 180) { double opacity = 1.0 - b.Brightness * 0.5 / 255; BackgroundImage.StartCompositionFadeAnimation(null, (float)opacity, 200, null, EasingFunctionNames.Linear); } }); }
public RepoDetailView() { //Loaded += (s, e) => TopScroller.InitializeScrollViewer(ReadmeScrollViewer); //Unloaded += (s, e) => TopScroller.Dispose(); InitializeComponent(); ViewModel = new RepoDetailViewmodel(); DataContext = ViewModel; DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += DataTransferManager_DataRequested; }
public RepoDetailView() { this.InitializeComponent(); ViewModel = new RepoDetailViewmodel(); this.DataContext = ViewModel; }