|
@@ -15,60 +15,36 @@ using System.Windows.Shapes;
|
|
|
|
|
|
namespace PartsWarehouse
|
|
|
{
|
|
|
- /// <summary>
|
|
|
- /// Логика взаимодействия для MainWindow.xaml
|
|
|
- /// </summary>
|
|
|
public partial class MainWindow : Window
|
|
|
{
|
|
|
public MainWindow()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
+ MainFrame.Content = new СatalogPage();
|
|
|
}
|
|
|
|
|
|
- private void SendMessage(string nickName, string message, string date, BitmapImage imageSource)
|
|
|
+ private void Border_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
- Grid messageGrid = new Grid();
|
|
|
- messageGrid.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x40, 0x44, 0x4B));
|
|
|
- messageGrid.Height = 45;
|
|
|
- messageGrid.Width = 590;
|
|
|
- messageGrid.Margin = new Thickness(10, 5, 10, 5);
|
|
|
-
|
|
|
- Image messageImage = new Image();
|
|
|
- messageImage.Source = imageSource;
|
|
|
- messageImage.Width = 35;
|
|
|
- messageImage.Height = 35;
|
|
|
- messageImage.Margin = new Thickness(5);
|
|
|
- messageImage.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
- messageGrid.Children.Add(messageImage);
|
|
|
-
|
|
|
- StackPanel stackpanel = new StackPanel();
|
|
|
- stackpanel.Orientation = Orientation.Horizontal;
|
|
|
-
|
|
|
- Label authorLabel = new Label();
|
|
|
- authorLabel.Content = nickName;
|
|
|
- authorLabel.Foreground = Brushes.White;
|
|
|
- authorLabel.FontWeight = FontWeights.Bold;
|
|
|
- authorLabel.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
- authorLabel.VerticalAlignment = VerticalAlignment.Top;
|
|
|
- authorLabel.Margin = new Thickness(40, 0, 0, 0);
|
|
|
-
|
|
|
- Label dateLabel = new Label();
|
|
|
- dateLabel.Content = date;
|
|
|
- dateLabel.Foreground = Brushes.White;
|
|
|
+ if (e.LeftButton == MouseButtonState.Pressed)
|
|
|
+ DragMove();
|
|
|
+ }
|
|
|
|
|
|
- stackpanel.Children.Add(authorLabel);
|
|
|
- stackpanel.Children.Add(dateLabel);
|
|
|
- messageGrid.Children.Add(stackpanel);
|
|
|
+ private void ButtonMininize_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ Application.Current.MainWindow.WindowState = WindowState.Minimized;
|
|
|
+ }
|
|
|
|
|
|
- Label messageLabel = new Label();
|
|
|
- messageLabel.Content = message;
|
|
|
- messageLabel.Foreground = Brushes.White;
|
|
|
- messageLabel.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
- messageLabel.VerticalAlignment = VerticalAlignment.Bottom;
|
|
|
- messageLabel.Margin = new Thickness(40, 0, 0, 0);
|
|
|
- messageGrid.Children.Add(messageLabel);
|
|
|
+ private void WindowStateButton_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ if (Application.Current.MainWindow.WindowState != WindowState.Maximized)
|
|
|
+ Application.Current.MainWindow.WindowState = WindowState.Maximized;
|
|
|
+ else
|
|
|
+ Application.Current.MainWindow.WindowState = WindowState.Normal;
|
|
|
+ }
|
|
|
|
|
|
- PartsListBox.Items.Add(messageGrid);
|
|
|
+ private void CloseButton_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ Application.Current.Shutdown();
|
|
|
}
|
|
|
}
|
|
|
}
|