powered by simpleCommunicator - 2.0.51     © 2025 Programmizd 02
Форумы / WPF, Silverlight [игнор отключен] [закрыт для гостей] / Re: Localization
1 сообщений из 1, страница 1 из 1
Re: Localization
    #37345961
Pavluha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Подскажите, как заставить увеличивать контент окна, а не выводить Scroll у DataGrid?


MainWindow:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
<Window x:Class="Monitoring.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:Controls="clr-namespace:Monitoring.Controls"
        Title="MainWindow"  Width="1024"
				WindowStartupLocation="CenterScreen" Height="Auto"
				ResizeMode="NoResize" MinHeight="710" >
	<DockPanel>
		<Border>
			<Grid>
				<Frame Focusable="False" Name="MainFrame" NavigationUIVisibility="Hidden" />
				<Controls:BusyIndicator Focusable="False" x:Name="BusyIndicator" />
			</Grid>
		</Border>
	</DockPanel>
</Window>

MainPage вкладываемый в Frame:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:magellan="http://xamlforge.com/magellan" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
		xmlns:res="clr-namespace:Monitoring.Properties"
    x:Class="Monitoring.Views.Shared.Main">
	<UserControl.Resources>
		<RoutedCommand x:Key="NavigationCommand" />
	</UserControl.Resources>
	<DockPanel Background="#a2b6c9">
		<StackPanel Orientation="Horizontal" VerticalAlignment="Top" DockPanel.Dock="Top" Background="Transparent" HorizontalAlignment="Right">
			<TextBlock>
				<Hyperlink Click="Hyperlink_Click" CommandParameter="ru">
					<Image Height="12" Source="/Monitoring;component/Images/Flag/ru.png" Margin="5"/>
				</Hyperlink>
				<Hyperlink Click="Hyperlink_Click" CommandParameter="en">
					<Image Height="12" Source="/Monitoring;component/Images/Flag/gb.png" Margin="5"/>
				</Hyperlink>
			</TextBlock>
		</StackPanel>
		<Image Height="122" Name="banner" Stretch="Fill" Width="Auto" DockPanel.Dock="Top" Source="/Monitoring;component/Images/logo.jpg" StretchDirection="Both" />
		<Border BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  Width="1004" Background="#ffffff" Margin="5" MinHeight="480" Height="Auto" DockPanel.Dock="Top">
			<DockPanel LastChildFill="True" >
				<ZonePlaceHolder Name="Header" DockPanel.Dock="Top" Margin="20 20 0 5" Foreground="#696969" FontSize="20" FontWeight="Bold" VerticalContentAlignment="Stretch"/>
				<ZonePlaceHolder Name="Content" Margin="20 0 0 0" VerticalContentAlignment="Stretch"/>
			</DockPanel>
		</Border>
		<Image Height="20" Name="footer" Stretch="Fill" Source="/Monitoring;component/Images/menu.jpg" StretchDirection="Both" />
	</DockPanel>
</UserControl>


Page вкладывается в <ZonePlaceHolder Name="Content" Margin="20 0 0 0" VerticalContentAlignment="Stretch"/>:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
<Page x:Class="Monitoring.Views.Monitoring.Operations"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			xmlns:res="clr-namespace:Monitoring.Properties"
	    xmlns:magellan="http://xamlforge.com/magellan" 
			xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
	    xmlns:my="clr-namespace:Monitoring.Core"
			Title="Operations">
	<Page.Resources>
		<my:VisibilityConverter x:Key="visibilityConverter"/>
	</Page.Resources>
	<Layout Source="/Monitoring;component/Views/Shared/Main.xaml">
		<Zone ZonePlaceHolderName="Header">
			<TextBlock Text="{x:Static res:Resources.Title_CDMTransactions}"/>
		</Zone>
		<Zone ZonePlaceHolderName="Content">
			<DockPanel LastChildFill="True" VerticalAlignment="Top" DataContext="{Binding}">
				<DataGrid ItemsSource="{Binding Transaction}" Background="Transparent" AutoGenerateColumns="False" BorderThickness="0" RowHeaderWidth="0" CanUserAddRows="False" 
									Margin="0,20,20,0" Visibility="{Binding Path=Transaction,Converter={StaticResource visibilityConverter}, ConverterParameter='Transaction'}">
					<DataGrid.ColumnHeaderStyle>
						<Style TargetType="{x:Type DataGridColumnHeader}">
							<Setter Property="FontWeight" Value="Bold" />
							<Setter Property="Background" Value="Transparent" />
							<Setter Property="FontSize" Value="12" />
							<Setter Property="HorizontalAlignment" Value="Center" />
						</Style>
					</DataGrid.ColumnHeaderStyle>
					<DataGrid.CellStyle>
						<Style TargetType="{x:Type DataGridCell}">
							<Setter Property="Block.TextAlignment" Value="Center"/>
						</Style>
					</DataGrid.CellStyle>
					<DataGrid.Columns>
						<DataGridTextColumn Binding="{Binding Path=timestamp}" Header="{x:Static res:Resources.DateTime}" Width="13*" >
							<DataGridTextColumn.CellStyle>
								<Style TargetType="{x:Type DataGridCell}">
									<Setter Property="Block.TextAlignment" Value="Right"/>
								</Style>
							</DataGridTextColumn.CellStyle>
						</DataGridTextColumn>
						<DataGridTextColumn Binding="{Binding Path=address}" Header="{x:Static res:Resources.Address}" Width="22*" >
							<DataGridTextColumn.CellStyle>
								<Style TargetType="{x:Type DataGridCell}">
									<Setter Property="Block.TextAlignment" Value="Right"/>
								</Style>
							</DataGridTextColumn.CellStyle>
						</DataGridTextColumn>
						<DataGridTextColumn Binding="{Binding Path=terminalName}" Header="{x:Static res:Resources.CDM}" Width="5*" >
							<DataGridTextColumn.CellStyle>
								<Style TargetType="{x:Type DataGridCell}">
									<Setter Property="Block.TextAlignment" Value="Right"/>
								</Style>
							</DataGridTextColumn.CellStyle>
						</DataGridTextColumn>
					</DataGrid.Columns>
				</DataGrid>
			</DockPanel>
		</Zone>
	</Layout>
</Page>

...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / WPF, Silverlight [игнор отключен] [закрыт для гостей] / Re: Localization
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]