- add: popup message
This commit is contained in:
@@ -9,75 +9,96 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:Nebula.Launcher.Models"
|
||||
xmlns:popup="clr-namespace:Nebula.Launcher.Views.Popup"
|
||||
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.DataContext>
|
||||
<viewModels:MainViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid
|
||||
ColumnDefinitions="65,*"
|
||||
Margin="0"
|
||||
RowDefinitions="*,40">
|
||||
|
||||
<TransitioningContentControl
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Content="{Binding CurrentPage}" />
|
||||
|
||||
<SplitView
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
CompactPaneLength="65"
|
||||
DisplayMode="CompactInline"
|
||||
IsPaneOpen="{Binding IsPaneOpen}"
|
||||
PaneBackground="#00000000">
|
||||
<SplitView.Pane>
|
||||
<Border
|
||||
BorderThickness="0,0,2,0"
|
||||
CornerRadius="0,8,8,0"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,5,0"
|
||||
Padding="0">
|
||||
<Grid ColumnDefinitions="*" RowDefinitions="*,40">
|
||||
<ListBox
|
||||
ItemsSource="{Binding Items}"
|
||||
Padding="0"
|
||||
Background="#00000000"
|
||||
SelectedItem="{Binding SelectedListItem}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type models:ListItemTemplate}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="17">
|
||||
<PathIcon Data="{Binding IconKey,
|
||||
Converter={x:Static converters:TypeConverters.IconConverter}}" Height="40" Width="40"/>
|
||||
<TextBlock Text="{Binding Label}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Button Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" Classes="ViewSelectButton"
|
||||
|
||||
<Panel>
|
||||
<Grid
|
||||
ColumnDefinitions="65,*"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Margin="0"
|
||||
RowDefinitions="*,40">
|
||||
|
||||
<TransitioningContentControl
|
||||
Content="{Binding CurrentPage}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0" />
|
||||
|
||||
<SplitView
|
||||
CompactPaneLength="65"
|
||||
DisplayMode="CompactInline"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="0"
|
||||
IsPaneOpen="{Binding IsPaneOpen}"
|
||||
PaneBackground="#00000000">
|
||||
<SplitView.Pane>
|
||||
<Border
|
||||
BorderThickness="0,0,2,0"
|
||||
CornerRadius="0,8,8,0"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,5,0"
|
||||
Padding="0">
|
||||
<Grid ColumnDefinitions="*" RowDefinitions="*,40">
|
||||
<ListBox
|
||||
Background="#00000000"
|
||||
ItemsSource="{Binding Items}"
|
||||
Padding="0"
|
||||
SelectedItem="{Binding SelectedListItem}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type models:ListItemTemplate}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="17">
|
||||
<PathIcon
|
||||
Data="{Binding IconKey, Converter={x:Static converters:TypeConverters.IconConverter}}"
|
||||
Height="40"
|
||||
Width="40" />
|
||||
<TextBlock Text="{Binding Label}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Button
|
||||
Classes="ViewSelectButton"
|
||||
Command="{Binding TriggerPaneCommand}"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Left"
|
||||
Padding="15,0,15,0"
|
||||
Command="{Binding TriggerPaneCommand}">
|
||||
<Label VerticalAlignment="Center" HorizontalAlignment="Center">|||</Label>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</SplitView.Pane>
|
||||
</SplitView>
|
||||
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
BorderThickness="0,2,0,0"
|
||||
CornerRadius="0,0,0,0"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,0"
|
||||
Padding="5">
|
||||
<Panel>
|
||||
<Label HorizontalAlignment="Left" VerticalAlignment="Center">cinka.ru</Label>
|
||||
<Label HorizontalAlignment="Right" VerticalAlignment="Center">v0.01</Label>
|
||||
</Panel>
|
||||
</Border>
|
||||
</Grid>
|
||||
VerticalAlignment="Stretch">
|
||||
<Label HorizontalAlignment="Center" VerticalAlignment="Center">|||</Label>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</SplitView.Pane>
|
||||
</SplitView>
|
||||
|
||||
<Border
|
||||
BorderThickness="0,2,0,0"
|
||||
CornerRadius="0,0,0,0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,0"
|
||||
Padding="5">
|
||||
<Panel>
|
||||
<Label HorizontalAlignment="Left" VerticalAlignment="Center">cinka.ru</Label>
|
||||
<Label HorizontalAlignment="Right" VerticalAlignment="Center">v0.01</Label>
|
||||
</Panel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Panel IsVisible="{Binding Popup}">
|
||||
<Border Background="#111" Opacity="50" />
|
||||
<Border
|
||||
CornerRadius="10"
|
||||
Height="320"
|
||||
Width="520">
|
||||
<popup:MessagePopupView />
|
||||
</Border>
|
||||
</Panel>
|
||||
</Panel>
|
||||
</UserControl>
|
||||
|
||||
21
Nebula.Launcher/Views/Popup/InfoPopupView.axaml
Normal file
21
Nebula.Launcher/Views/Popup/InfoPopupView.axaml
Normal file
@@ -0,0 +1,21 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Nebula.Launcher.Views.Popup.InfoPopupView"
|
||||
x:DataType="viewModels:InfoPopupViewModel"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.DataContext>
|
||||
<viewModels:InfoPopupViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Panel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Label>
|
||||
<TextBlock Text="{Binding InfoText}" />
|
||||
</Label>
|
||||
</Panel>
|
||||
</UserControl>
|
||||
19
Nebula.Launcher/Views/Popup/InfoPopupView.axaml.cs
Normal file
19
Nebula.Launcher/Views/Popup/InfoPopupView.axaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Nebula.Launcher.ViewModels;
|
||||
|
||||
namespace Nebula.Launcher.Views.Popup;
|
||||
|
||||
public partial class InfoPopupView : UserControl
|
||||
{
|
||||
public InfoPopupView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public InfoPopupView(InfoPopupViewModel viewModel) : this()
|
||||
{
|
||||
DataContext = viewModel;
|
||||
}
|
||||
}
|
||||
53
Nebula.Launcher/Views/Popup/MessagePopupView.axaml
Normal file
53
Nebula.Launcher/Views/Popup/MessagePopupView.axaml
Normal file
@@ -0,0 +1,53 @@
|
||||
<UserControl
|
||||
d:DesignHeight="320"
|
||||
d:DesignWidth="520"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Nebula.Launcher.Views.Popup.MessagePopupView"
|
||||
x:DataType="viewModels:MessagePopupViewModel"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.DataContext>
|
||||
<viewModels:MessagePopupViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid RowDefinitions="35,*,20">
|
||||
<Border
|
||||
BorderThickness="0,0,0,2"
|
||||
CornerRadius="10,10,0,0"
|
||||
Grid.Row="0">
|
||||
<Panel Margin="12,0,12,0" VerticalAlignment="Center">
|
||||
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||
<Label VerticalAlignment="Center">Title</Label>
|
||||
</StackPanel>
|
||||
<Button
|
||||
Content="Close"
|
||||
HorizontalAlignment="Right"
|
||||
Padding="15,0,15,0"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="CloseButton" />
|
||||
</Panel>
|
||||
</Border>
|
||||
|
||||
<TransitioningContentControl Content="{Binding CurrentPopup}" Grid.Row="0" />
|
||||
|
||||
<Border
|
||||
BorderThickness="0,2,0,2"
|
||||
CornerRadius="0,0,10,10"
|
||||
Grid.Row="2">
|
||||
<Panel Margin="12,0,12,0" VerticalAlignment="Center">
|
||||
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||
<Label
|
||||
FontSize="8"
|
||||
Foreground="#666666"
|
||||
VerticalAlignment="Center">
|
||||
Дальше бога нет...
|
||||
</Label>
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
26
Nebula.Launcher/Views/Popup/MessagePopupView.axaml.cs
Normal file
26
Nebula.Launcher/Views/Popup/MessagePopupView.axaml.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Nebula.Launcher.ViewModels;
|
||||
|
||||
namespace Nebula.Launcher.Views.Popup;
|
||||
|
||||
public partial class MessagePopupView : UserControl
|
||||
{
|
||||
// This constructor is used when the view is created by the XAML Previewer
|
||||
public MessagePopupView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// This constructor is used when the view is created via dependency injection
|
||||
public MessagePopupView(MessagePopupViewModel viewModel)
|
||||
: this()
|
||||
{
|
||||
DataContext = viewModel;
|
||||
Console.WriteLine("NO SOSAL");
|
||||
CloseButton.KeyDown += (_,_) => Console.WriteLine("GGG11");
|
||||
CloseButton.Click += (_,_) => Console.WriteLine("GGG");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user