193 lines · 12.9 KB · Text
RawDownload
<UserControl x:Class="PowerCalculations.UI.WPF.UserControls.PowerCalculationUserControl"             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:userControls1="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"			 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"			 xmlns:binding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI"             xmlns:viewModels1="clr-namespace:PowerCalculations.UI.WPF.ViewModels"             xmlns:userControls="clr-namespace:PowerCalculations.UI.WPF.UserControls"             mc:Ignorable="d"              d:DesignHeight="500" d:DesignWidth="1300" d:DataContext="{d:DesignInstance viewModels1:PowerCalculationViewModel, IsDesignTimeCreatable=True}"             PreviewKeyDown="PowerCalculationUserControl_PreviewKeyDown"> 	<UserControl.Resources>		<ResourceDictionary>			<ResourceDictionary.MergedDictionaries>                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/StyleResource.xaml" />            </ResourceDictionary.MergedDictionaries>        </ResourceDictionary>	</UserControl.Resources> 	<StackPanel Orientation="Vertical">		<Grid HorizontalAlignment="Center">			<Grid.RowDefinitions>				<RowDefinition Height="Auto" />				<RowDefinition Height="Auto" />			</Grid.RowDefinitions> 			<GroupBox Grid.Row="0" Header="Power Calculation Detail">				<StackPanel Orientation="Vertical">					<Grid x:Name="GridDetailView" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5"  DataContext="{Binding CurrentItem, Mode=TwoWay}">						<Grid.RowDefinitions>							<RowDefinition Height="Auto"/>							<RowDefinition Height="Auto"/>							<RowDefinition Height="Auto"/>							<RowDefinition Height="Auto"/>							<RowDefinition Height="Auto"/>							<RowDefinition Height="Auto"/>						</Grid.RowDefinitions> 						<Grid.ColumnDefinitions>							<ColumnDefinition Width="Auto"/>							<ColumnDefinition Width="Auto"/>							<ColumnDefinition Width="Auto"/>							<ColumnDefinition Width="Auto"/>						</Grid.ColumnDefinitions> 						<TextBlock Grid.Row="1" Grid.Column="0" Text="Voltage Phasor" TextAlignment="Right"/>						<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="1">							<StackPanel Orientation="Horizontal">								<TextBox Text="{Binding VoltagePhasor.Label, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />                                <ToggleButton x:Name="VoltagePhasorToggle" Padding="0" Content="..." Width="25" Height="22" />							</StackPanel>							<Popup IsOpen="{Binding ElementName=VoltagePhasorToggle, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Opened="Popup_Opened">                                <StackPanel Background="LightGray">								    <userControls:PhasorSelectionUserControl x:Name="VoltagePhasorSelector" PhasorTypeFilter="Voltage" Loaded="PhasorSelector_Loaded" />                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">                                        <Button Content="Clear" Click="ClearVoltagePhasor_Click" />                                        <Button Content="Close" Click="CloseButton_Click" />                                    </StackPanel>                                </StackPanel>                            </Popup>                        </StackPanel>                         <TextBlock Grid.Row="2" Grid.Column="0" Text="Current Phasor" TextAlignment="Right"/>						<StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="1">							<StackPanel Orientation="Horizontal">								<TextBox Text="{Binding CurrentPhasor.Label, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />                                <ToggleButton x:Name="CurrentPhasorToggle" Padding="0" Content="..." Width="25" Height="22" />							</StackPanel>                            <Popup IsOpen="{Binding ElementName=CurrentPhasorToggle, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Opened="Popup_Opened">                                <StackPanel Background="LightGray">								    <userControls:PhasorSelectionUserControl x:Name="CurrentPhasorSelector" PhasorTypeFilter="Current" Loaded="PhasorSelector_Loaded" />                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">                                        <Button Content="Clear" Click="ClearCurrentPhasor_Click" />                                        <Button Content="Close" Click="CloseButton_Click" />                                    </StackPanel>                                </StackPanel>                            </Popup>                        </StackPanel>                         <TextBlock Grid.Row="3" Grid.Column="0" Text="Circuit Description" TextAlignment="Right"/>                        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding CircuitDescription, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>                         <TextBlock Grid.Row="4" Grid.Column="0" Text="Runtime ID" />                        <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">                            <TextBlock Loaded="RuntimeIDTextBlock_Loaded" />                            <Button Content="Initialize" Click="InitializeButton_Click" />                        </StackPanel>                         <TextBlock Grid.Row="0" Grid.Column="3">(Leave blank to use template names)</TextBlock> 						<TextBlock Grid.Row="1" Grid.Column="2" Text="Active Power Output Alt Tag Name" TextAlignment="Right" />						<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="3">							<StackPanel Orientation="Horizontal">								<TextBox Text="{Binding ActivePowerOutputMeasurement.PointTag, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />                                <ToggleButton x:Name="ActivePowerOutputToggle" Padding="0" Content="..." Width="25" Height="22" />							</StackPanel>                            <Popup IsOpen="{Binding ElementName=ActivePowerOutputToggle, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="650" Opened="Popup_Opened">								<StackPanel Orientation="Vertical" Background="LightGray">									<userControls1:MeasurementPagerUserControl x:Name="ActiveMeasurementPager" Loaded="MeasurementPager_Loaded" />                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">                                        <Button Content="Clear" Click="ClearActiveMeasurement_Click" />                                        <Button Content="Close" Click="CloseButton_Click" />                                    </StackPanel>                                </StackPanel>							</Popup>						</StackPanel>												<TextBlock Grid.Row="2" Grid.Column="2" Text="Reactive Power Output Alt Tag Name" TextAlignment="Right" />						<StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="3">							<StackPanel Orientation="Horizontal">								<TextBox Text="{Binding ReactivePowerOutputMeasurement.PointTag, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />                                <ToggleButton x:Name="ReactivePowerOutputToggle" Padding="0" Content="..." Width="25" Height="22" />							</StackPanel>                            <Popup IsOpen="{Binding ElementName=ReactivePowerOutputToggle, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="650" Opened="Popup_Opened">								<StackPanel Orientation="Vertical" Background="LightGray">									<userControls1:MeasurementPagerUserControl x:Name="ReactiveMeasurementPager" Loaded="MeasurementPager_Loaded" />                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">                                        <Button Content="Clear" Click="ClearReactiveMeasurement_Click" />                                        <Button Content="Close" Click="CloseButton_Click" />                                    </StackPanel>                                </StackPanel>							</Popup>						</StackPanel> 						<TextBlock Grid.Row="3" Grid.Column="2" Text="Apparent Power Output Alt Tag Name" TextAlignment="Right" />						<StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="3">							<StackPanel Orientation="Horizontal">								<TextBox Text="{Binding ApparentPowerOutputMeasurement.PointTag, Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" />                                <ToggleButton x:Name="ApparentPowerOutputToggle" Padding="0" Content="..." Width="25" Height="22" />							</StackPanel>                            <Popup IsOpen="{Binding ElementName=ApparentPowerOutputToggle, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="650" Opened="Popup_Opened">								<StackPanel Orientation="Vertical" Background="LightGray">									<userControls1:MeasurementPagerUserControl x:Name="ApparentMeasurementPager" Loaded="MeasurementPager_Loaded" />                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">                                        <Button Content="Clear" Click="ClearApparentMeasurement_Click" />                                        <Button Content="Close" Click="CloseButton_Click" />                                    </StackPanel>                                </StackPanel>							</Popup>						</StackPanel> 						<CheckBox Grid.Row="4" Grid.Column="2" IsChecked="{Binding Enabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Content="Enabled" HorizontalAlignment="Right"/>					</Grid> 					<userControls1:DetailViewFooterUserControl x:Name="UserControlDetailViewFooter" DeleteCommand="{Binding DeleteCommand}" ClearCommand="{Binding ClearCommand}" SaveCommand="{Binding SaveCommand}" HorizontalAlignment="Right" SaveEnabled="{binding:DataOperation Path=(Validation.HasError)}"/>				</StackPanel>			</GroupBox>		</Grid> 		<sdk:DataGrid x:Name="DataGridList" ItemsSource="{Binding CurrentPage}" SelectedItem="{Binding Path=CurrentItem, Mode=TwoWay}" SelectedIndex="{binding:Column Path=CurrentSelectedIndex}">			<!--PreviewKeyDown="DataGrid_PreviewKeyDown" Sorting="DataGrid_Sorting" CellEditEnding="DataGrid_CellEditEnding">-->			<sdk:DataGrid.Columns>                <sdk:DataGridTextColumn Header="ID" Width="100" Binding="{Binding ID, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">                    <sdk:DataGridTextColumn.ElementStyle>                        <Style TargetType="{x:Type TextBlock}">                            <Setter Property="HorizontalAlignment" Value="Center" />                        </Style>                    </sdk:DataGridTextColumn.ElementStyle>                </sdk:DataGridTextColumn>				<sdk:DataGridTemplateColumn Header="Circuit Description" Width="*" SortMemberPath="CircuitDescription">					<sdk:DataGridTemplateColumn.CellTemplate>						<DataTemplate>                            <Button Margin="0" Template="{StaticResource HyperlinkStyleButtonTemplate}" Content="{binding:Column Path=CircuitDescription}"                                     Command="{binding:GridButtonCommand Path=DataContext.EditCommand}"                                     CommandParameter="{binding:GridButtonCommand Path=DataContext.CurrentItem}" ToolTip="{Binding Path=CircuitDescription}" Width="Auto">                                <Button.Resources>                                    <Style TargetType="{x:Type TextBlock}">                                        <Setter Property="Margin" Value="0" />                                    </Style>                                </Button.Resources>                            </Button>						</DataTemplate>					</sdk:DataGridTemplateColumn.CellTemplate>				</sdk:DataGridTemplateColumn>				<sdk:DataGridTemplateColumn Header="Enabled" Width="200" SortMemberPath="Enabled" >					<sdk:DataGridTemplateColumn.CellTemplate>						<DataTemplate>							<CheckBox IsChecked="{Binding Enabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" />						</DataTemplate>					</sdk:DataGridTemplateColumn.CellTemplate>				</sdk:DataGridTemplateColumn>			</sdk:DataGrid.Columns>		</sdk:DataGrid> 		<userControls1:DataPagerUserControl CurrentPageNumber="{Binding CurrentPageNumber}" PageCount="{Binding PageCount}"                                 FirstCommand="{Binding FirstCommand}" PreviousCommand="{Binding PreviousCommand}"                                 NextCommand="{Binding NextCommand}" LastCommand="{Binding LastCommand}" VerticalAlignment="Bottom"/>	</StackPanel></UserControl>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t