TextBox style set

This commit is contained in:
Natlinux81
2022-02-24 23:24:58 +01:00
parent fc965ab69c
commit 19ef7ba65c
21 changed files with 120 additions and 108 deletions

Binary file not shown.

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace LotteryApplication.Core
{
internal class ObservableObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
public void OnPropertychanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}

View File

@@ -1,37 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace LotteryApplication.Core
{
internal class RelayCommand : ICommand
{
private Action<object> _execute;
private Func<object, bool> _canExecute;
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
{
_execute = execute;
_canExecute = canExecute;
}
public bool CanExecute(object parameter)
{
return _canExecute == null || _canExecute(parameter);
}
public void Execute(object parameter)
{
_execute(parameter);
}
}
}

View File

@@ -11,13 +11,6 @@
<None Remove="Images\Lottery.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="MVVM\ViewModel\" />
<Folder Include="MVVM\View\" />
<Folder Include="MVVM\Model\" />
<Folder Include="Fonts\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Lottery.png" />
</ItemGroup>

View File

@@ -21,7 +21,6 @@
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition Height="235"/>
@@ -32,10 +31,12 @@
<ColumnDefinition Width="350"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0"
Grid.ColumnSpan="2"
Background="Transparent"
MouseDown="Border_MouseDown"/>
<Button Grid.Column="1"
BorderThickness="0"
Background="Transparent"
@@ -44,8 +45,8 @@
Margin="0,0,15,0"
Height="25"
Width="25"
Content="✖" Click="BtnExit"
/>
Content="✖" Click="BtnExit"/>
<Button Grid.Column="1"
BorderThickness="0"
Background="Transparent"
@@ -60,6 +61,7 @@
<StackPanel Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center">
<TextBlock
HorizontalAlignment="Center"
Text="Lottery"
@@ -90,11 +92,19 @@
FontSize="18"
FontWeight="Bold"
FontFamily="MV Boli"
Foreground="#FF157315"/>
<TextBox
Foreground="#FF157315"
/>
<TextBox x:Name="FirstTicket"
Grid.Column="1"
Foreground="#FF157315"
FontSize="14"
Style="{StaticResource ModernTextbox}"/>
FontWeight="Bold"
HorizontalAlignment="Left"
Width="150"
BorderBrush="#FF157315"
BorderThickness="3"
Background="Transparent"
Style="{StaticResource ModernTextbox}" />
<TextBlock Grid.Row="1"
Margin="0,20"
@@ -103,10 +113,18 @@
FontWeight="Bold"
FontFamily="MV Boli"
Foreground="#FF157315"/>
<TextBox Margin="0,20" Grid.Row="1"
<TextBox x:Name="LastTicket"
HorizontalAlignment="Left"
Margin="0,20" Grid.Row="1"
Grid.Column="1"
Foreground="#FF157315"
FontSize="14"
Style="{StaticResource ModernTextbox}"/>
FontWeight="Bold"
Width="150"
BorderBrush="#FF157315"
BorderThickness="3"
Background="Transparent"
Style="{StaticResource ModernTextbox}" />
</Grid>
@@ -117,22 +135,36 @@
Content="Start Raffle"
FontSize="20" Click="BtnRaffleClick"/>
</StackPanel>
<ListBox Grid.Row="1"
Grid.Column="1"
Grid.RowSpan="2"
Margin="0,0,15,15"
<StackPanel Margin="0,0,15,5"
Grid.Row="1"
Grid.Column="1"
Grid.RowSpan="2">
<TextBlock Text="Winning Tickets"
FontFamily="MV Boli"
FontSize="18"
HorizontalAlignment="Center"
Foreground="White"
Margin="2">
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
<ListBox
Background="Transparent"
x:Name="TicketList"
Foreground="#FF157315"
FontWeight="Bold"
FontSize="14"
BorderThickness="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="4"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="4"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</StackPanel>
</Grid>
</Border>

View File

@@ -20,25 +20,25 @@ namespace LotteryApplication
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
InitializeComponent();
}
public void StartRaffel()
{
Random rnd = new Random();
}
private void BtnRaffleClick(object sender, RoutedEventArgs e)
{
int num1 = int.Parse(FirstTicket.Text);
int num2 = int.Parse(LastTicket.Text);
TicketList.Items.Clear();
Random rnd = new Random();
for(int i = 0; i <= 99; i++)
for (int i = 0; i <= 99; i++)
TicketList.Items.Add(rnd.Next(num1, num2));
TicketList.Items.Add(rnd.Next(10000));
}
private void BtnExit(object sender, RoutedEventArgs e)

View File

@@ -1 +1 @@
0f20a831c00feea0a0583ea6285b35ab99c41884
4732b0e2a1138fb3ecad0b9cb69c286a25bbe38e

View File

@@ -12,7 +12,7 @@ TRACE;DEBUG;NET;NET5_0;NETCOREAPP
C:\Nathalie\Programmieren\Projekte\LotteryApplication\LotteryApplication\App.xaml
3-605903882
5-691000765
3-1233169557
193-1891726104
MainWindow.xaml;Theme\ModernButtonTheme.xaml;Theme\ModernTextBoxTheme.xaml;

View File

@@ -12,7 +12,7 @@ TRACE;DEBUG;NET;NET5_0;NETCOREAPP
C:\Nathalie\Programmieren\Projekte\LotteryApplication\LotteryApplication\App.xaml
3-605903882
71897431273
51355262481
193-1891726104
MainWindow.xaml;Theme\ModernButtonTheme.xaml;Theme\ModernTextBoxTheme.xaml;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3FDCBBD618281872401463539A24B88773C2E06B"
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "78002E44A7F27DECE1537F2570F60833B1B8DA6A"
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
@@ -42,7 +42,23 @@ namespace LotteryApplication {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 125 "..\..\..\MainWindow.xaml"
#line 97 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox FirstTicket;
#line default
#line hidden
#line 116 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox LastTicket;
#line default
#line hidden
#line 154 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ListBox TicketList;
@@ -89,7 +105,7 @@ namespace LotteryApplication {
return;
case 2:
#line 47 "..\..\..\MainWindow.xaml"
#line 48 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnExit);
#line default
@@ -97,21 +113,27 @@ namespace LotteryApplication {
return;
case 3:
#line 58 "..\..\..\MainWindow.xaml"
#line 59 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnMinimizeClick);
#line default
#line hidden
return;
case 4:
this.FirstTicket = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.LastTicket = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
#line 118 "..\..\..\MainWindow.xaml"
#line 136 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnRaffleClick);
#line default
#line hidden
return;
case 5:
case 7:
this.TicketList = ((System.Windows.Controls.ListBox)(target));
return;
}

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3FDCBBD618281872401463539A24B88773C2E06B"
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "78002E44A7F27DECE1537F2570F60833B1B8DA6A"
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
@@ -42,7 +42,23 @@ namespace LotteryApplication {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 125 "..\..\..\MainWindow.xaml"
#line 97 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox FirstTicket;
#line default
#line hidden
#line 116 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox LastTicket;
#line default
#line hidden
#line 154 "..\..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ListBox TicketList;
@@ -89,7 +105,7 @@ namespace LotteryApplication {
return;
case 2:
#line 47 "..\..\..\MainWindow.xaml"
#line 48 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnExit);
#line default
@@ -97,21 +113,27 @@ namespace LotteryApplication {
return;
case 3:
#line 58 "..\..\..\MainWindow.xaml"
#line 59 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnMinimizeClick);
#line default
#line hidden
return;
case 4:
this.FirstTicket = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.LastTicket = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
#line 118 "..\..\..\MainWindow.xaml"
#line 136 "..\..\..\MainWindow.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.BtnRaffleClick);
#line default
#line hidden
return;
case 5:
case 7:
this.TicketList = ((System.Windows.Controls.ListBox)(target));
return;
}