Klassen vom MainWindow getrennt

+ Klassen getrennt
+ Business Schicht abgeändert
This commit is contained in:
Erik 2024-08-14 14:31:45 +02:00
parent 80f2610b04
commit a05b392aea
6 changed files with 56 additions and 35 deletions

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bib_talk.Business
{
public class Message
{
public int Id { get; set; }
public string Username { get; set; }
public string Text { get; set; }
public DateTime Timestamp { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bib_talk.Business
{
public class MessageDto
{
public string Username { get; set; }
public string Message { get; set; }
public DateTime Timestamp { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bib_talk.Business
{
public class User
{
public int Id { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Email { get; set; }
public string Birthday { get; set; }
public string IsOnline { get; set; }
public string ProfileImagePath { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using bib_talk.Business;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View File

@ -132,7 +132,7 @@
</Grid>
<ListBox x:Name="onlineUsersListBox" Margin="76,112,339,0" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged="onlineUsersListBox_SelectionChanged" Grid.RowSpan="2">
<ListBox x:Name="onlineUsersListBox" Margin="76,112,339,0" d:ItemsSource="{d:SampleData ItemCount=5}" Background="#FF323134" BorderBrush="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Grid.RowSpan="2">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="205" Height="60">

View File

@ -120,7 +120,6 @@ namespace bib_talk
private void Popup_LostFocus(object sender, RoutedEventArgs e)
{
ClosePopup();
}
@ -129,10 +128,10 @@ namespace bib_talk
popup.IsOpen = false;
}
private void onlineUsersListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//private void onlineUsersListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
//{
}
//}
private async void uploadpbclick(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
@ -144,33 +143,4 @@ namespace bib_talk
}
}
}
public class Message
{
public int Id { get; set; }
public string Username { get; set; }
public string Text { get; set; }
public DateTime Timestamp { get; set; }
}
public class MessageDto
{
public string Username { get; set; }
public string Message { get; set; }
public DateTime Timestamp { get; set; }
}
public class User
{
public int Id { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Email { get; set; }
public string Birthday { get; set; }
public string IsOnline { get; set; }
public string ProfileImagePath { get; set; }
}
}