Есть форма, на которой при нажатии на кнопку "x:Name="StartChatWithUser_btn""
происходит вызов UserControl
окна, и стоит дилемма, как закрыть UserControl
при нажатии на кнопку "x:Name="Return_btn""
.
XAML первой формы:
<StackPanel x:Name="WindowChat" Grid.RowSpan="3" Background="White" Width="400" Height="630" Initialized="WindowChat_Initialized" >
<StackPanel.Effect>
<DropShadowEffect BlurRadius="30" ShadowDepth="5" Color="#FFACACAC"/>
</StackPanel.Effect>
<Grid Height="80" Background="White">
<Grid.Effect>
<DropShadowEffect BlurRadius="30" ShadowDepth="5" Color="#FFACACAC"/>
</Grid.Effect>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Чат" Grid.Column="0" HorizontalAlignment="Center" FontSize="25"
VerticalAlignment="Center" Margin="10"/>
<Button Grid.Column="2" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
Width="25" Height="25" Padding="0" Background="{x:Null}" BorderBrush="{x:Null}"
Foreground="{x:Null}" Margin="15" VerticalAlignment="Center" HorizontalAlignment="Center"
MouseLeave="CancelMaterialWindow_Cancel_MouseLeave"
MouseEnter="CancelMaterialWindow_Cancel_MouseEnter"
Click="CancelMaterialWindow_Cancel_Click">
<materialDesign:PackIcon Kind="Close" Foreground="Black"/>
</Button>
</Grid>
<Grid Height="60" Margin="0 10 0 0" >
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="10 0">
<Button x:Name="ContactGrupe_btn" Uid="0" Width="170" Content="КОНТАКТЫ" Height="40"
Background="{x:Null}" BorderBrush="{x:Null}" Foreground="Gray" Click="ContactGrupe_btn_Click"/>
<Button Uid="1" Width="170" Content="АДМИНИСТРАТОРЫ" Height="40" Background="{x:Null}" BorderBrush="{x:Null}"
Foreground="Gray" Click="ContactGrupe_btn_Click"/>
</StackPanel>
<Grid x:Name="GridCursor" Width="170" Height="5" Background="#FF00CC99" HorizontalAlignment="Left"
Margin="10 0" Grid.Row="1"/>
</Grid>
<Grid x:Name="ChatUsers_Grid" Height="440">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="White" Height="40" Width="300" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.Effect>
<DropShadowEffect BlurRadius="30" ShadowDepth="5" Color="#FFACACAC"/>
</Grid.Effect>
<TextBlock Text="Петя" Grid.Column="0" HorizontalAlignment="Left" FontSize="25"
VerticalAlignment="Center" Margin="10"/>
<Button x:Name="StartChatWithUser_btn" Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}" Width="30" Height="30"
Grid.Column="2" Margin="5" Click="StartChatWithUser_btn_Click">
<materialDesign:PackIcon Kind="Telegram" Height="24" Width="24" />
</Button>
</Grid>
</Grid>
</StackPanel>
XAML UserControl окна:
<StackPanel x:Name="MessegingWindow" Background="White" >
<Grid Height="80" Background="White">
<Grid.Effect>
<DropShadowEffect BlurRadius="30" ShadowDepth="5" Color="#FFACACAC"/>
</Grid.Effect>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Button x:Name="Return_btn" Grid.Column="0" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
Width="25" Height="25" Padding="0" Background="{x:Null}" BorderBrush="{x:Null}"
Foreground="{x:Null}" Margin="15" VerticalAlignment="Center" HorizontalAlignment="Center"
Click="Return_btn_Click"
>
<materialDesign:PackIcon Kind="ArrowBack" Foreground="Black" Width="25" Height="25"/>
</Button>
<Button Grid.Column="2" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
Width="25" Height="25" Padding="0" Background="{x:Null}" BorderBrush="{x:Null}"
Foreground="{x:Null}" Margin="15" VerticalAlignment="Center" HorizontalAlignment="Center"
>
<materialDesign:PackIcon Kind="Close" Foreground="Black"/>
</Button>
</Grid>
<Grid Height="390" Margin="0 10 0 0">
<TextBlock x:Name="Text"/>
</Grid>
<Grid Height="100">
<Border Margin="5" Background="White" VerticalAlignment="Bottom" Padding="2" CornerRadius="10" >
<Border.Effect>
<DropShadowEffect BlurRadius="30" Color="LightGray" ShadowDepth="0"/>
</Border.Effect>
<StackPanel>
<Border Grid.Row="6">
<Grid Margin="0 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="70"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="Messeg_Txt" MaxHeight="100" TextWrapping="Wrap" Margin="5"
AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Grid.ColumnSpan="2"
materialDesign:HintAssist.Hint="Введите сообщение*"
Style="{StaticResource MaterialDesignFloatingHintTextBox}" Foreground="Black"
TextChanged="Messeg_Txt_TextChanged"/>
</Grid>
</Border>
</StackPanel>
</Border>
</Grid>
<Grid Height="50">
<Button x:Name="SendMesseg_Btn" Style="{StaticResource MaterialDesignRaisedButton}" Content="Отправить" Margin="10" Foreground="WhiteSmoke"
Background="#FF33425C" Visibility="Collapsed"/>
<Button x:Name="SendMessegOff_Btn" Style="{StaticResource MaterialDesignFlatButton}" Content="Отправить" Margin="10" Foreground="DimGray"
Background="#FFE0E0E0"/>
</Grid>
</StackPanel>
Виртуальный выделенный сервер (VDS) становится отличным выбором
У меня есть проект на C#Мне нужно построить изогнутый цилиндр
Хочу добавить логирование в проект, но по все гайдам нужно через References в NuGet найти log4net
Помогите исправить кодЯ пишу тип-обёртку в проекте для нейронных сетей и я хочу чтобы изменяя в этой структуре тип с double на float, ufloat, double, udouble,...
Я могу переместить все изменения, используя функцию Visual Studio Переместить изменения из одной ветви в другую