Skip to content

Commit

Permalink
fixed underscore in user button (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
dosymep committed May 15, 2022
1 parent 9bd1f62 commit dd8b8a3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev/pyRevitLabs/pyRevitLabs.CommonWPF/Windows/AppWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Media.Imaging;
using System.ComponentModel;
using System.Windows.Data;
using System.Xaml;

// packages
using pyRevitLabs.MahAppsMetro;
Expand All @@ -25,12 +26,18 @@ public AppWindow() {
private void InitializeComponent() {
// setting up user name and app version buttons
var windowButtons = new WindowCommands();

var userButton = new Button() {
Content = CurrentUser,
ToolTip = "Active User. Click to copy to clipboard.",
Focusable = false
};

FrameworkElementFactory textBlockFactory
= new FrameworkElementFactory(typeof(TextBlock));
textBlockFactory.SetValue(TextBlock.TextProperty, CurrentUser);

userButton.ContentTemplate = new DataTemplate(typeof(string));
userButton.ContentTemplate.VisualTree = textBlockFactory;

userButton.Click += Copy_Button_Title;
windowButtons.Items.Add(userButton);
Expand Down

0 comments on commit dd8b8a3

Please sign in to comment.