Skip to content

Commit

Permalink
Merge pull request #2245 from nicehash/3.0.5.6-exit
Browse files Browse the repository at this point in the history
do not show exit button on update customdialog
  • Loading branch information
S74nk0 committed Dec 16, 2020
2 parents 4765813 + 9ecd19d commit fd9d2b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/NiceHashMiner/Views/Common/CustomDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<Button Grid.Row="0"
Style="{StaticResource local.ExitTextButton}"
Content="&#xF00D;"
Visibility="{Binding ExitVisible}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Click="CloseDialog"/>
Expand Down
9 changes: 9 additions & 0 deletions src/NiceHashMiner/Views/Common/CustomDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public partial class CustomDialog : UserControl
public static readonly DependencyProperty AnimationVisibleProperty =
DependencyProperty.Register(nameof(AnimationVisible), typeof(Visibility), typeof(CustomDialog));

public static readonly DependencyProperty ExitVisibleProperty =
DependencyProperty.Register(nameof(ExitVisible), typeof(Visibility), typeof(CustomDialog));

public CustomDialog()
{
InitializeComponent();
Expand Down Expand Up @@ -108,6 +111,12 @@ public Visibility AnimationVisible
set => SetValue(AnimationVisibleProperty, value);
}

public Visibility ExitVisible
{
get => (Visibility)GetValue(ExitVisibleProperty);
set => SetValue(ExitVisibleProperty, value);
}

public bool CloseOnOk { get; set; } = true;
public bool CloseOnCancel { get; set; } = true;

Expand Down
3 changes: 2 additions & 1 deletion src/NiceHashMiner/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
OkText = Translations.Tr("OK"),
CancelVisible = Visibility.Collapsed,
OkVisible = Visibility.Collapsed,
AnimationVisible = Visibility.Visible
AnimationVisible = Visibility.Visible,
ExitVisible = Visibility.Collapsed
};
ShowContentAsModalDialog(nhmUpdaterDialog);
});
Expand Down

0 comments on commit fd9d2b9

Please sign in to comment.