积善之家必有余庆,积恶之家必有余殃。
拥抱变化、抓住机遇、才能赢得未来。
PathGeometry 表示一个可能由弧、曲线、椭圆、直线和矩形组成的复杂形状。
https://www.cnblogs.com/tsliwei/p/5609035.html
<Path Stroke="Black" StrokeThickness="1">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure IsClosed="True" StartPoint="10,100">
<PathFigure.Segments>
<PathSegmentCollection>
<LineSegment Point="100,100" />
<LineSegment Point="100,50" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
PolyLineSegment
表示由 PointCollection 定义的线段集合,每个 Point 指定线段的终点。
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
<ContentControl IsEnabled="{Binding xx}" x:Name="TabRegion"
Grid.Row="1"
prism:RegionManager.RegionName="{x:Static inf:RegionNames.TabRegion}"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch" Margin="10,10,0,9"/>
[Import("Prism.Regions.IRegionManager")]
private IRegionManager regionManager;
regionManager.RequestNavigate(RegionNames.TabRegion, strSource);
[Import("Prism.Events.IEventAggregator")]
protected IEventAggregator eventAggregator;
private IEventAggregator eventAggregator;
this.eventAggregator = eventAggregator;
eventAggregator.GetEvent<PSEvent>().Subscribe(ProgressShowData);
eventAggregator.GetEvent<PSEvent>().Publish(Msg);
private stringbuilder pShow=new stringbuilder();
public string PShow
{
get { return pShow.ToString(); }
set
{
pShow.Append(value).AppendLine();
this.RaisePropertyChanged("PShow");
}
}
1、 <ContentControl prism:RegionManager.RegionName="XXX"/> xxx.xaml
2、在本工程模块或者 其它类库中新建 Standing.xaml 和 StandingList.xaml , 并在其对应模块的 cs 部分加入 用户 prism 导出
[Export("Standing", typeof(Standing))]
/// <summary>
/// StandAssetsList.xaml 的交互逻辑
/// </summary>
public partial class Standing: UserControl
{
public Standing()
{
InitializeComponent();
}
}
[Export("StandingList", typeof(StandingList))]
/// <summary>
/// StandAssetsList.xaml 的交互逻辑
/// </summary>
public partial class StandingList: UserControl
{
public StandingList()
{
InitializeComponent();
}
}
cs文件
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
RegionManager.RequestNavigate("XXX", "Standing");
}
[Import]
public IRegionManager RegionManager { get; private set; }
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Height="561" Margin="10,10,10,0" Grid.Column="1" VerticalAlignment="Top">
<i:Interaction.Behaviors>
<behaviors:ScrollToEndBehavior/>
</i:Interaction.Behaviors>
</ScrollViewer>
<RichTextBox IsReadOnly="True" BorderThickness="0" BorderBrush="Transparent" Padding="10,10,10,0">
<FlowDocument>
<Paragraph>
<Run Text="{Binding PShow}"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
<Style x:Key="CButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border x:Name="border" BorderBrush="{Binding BorderBrush}" BorderThickness="{Binding BorderThickness}" Background="{Binding Background}" SnapsToDevicePixels="True" CornerRadius="90">
<ContentPresenter x:Name="cPresenter" ContentTemplate="{Binding ContentTemplate}" Content="{Binding Content}" "/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
<Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
</Trigger>
</ControlTemplate.Triggers>
</controlTemplate>
</Setter.Value>
<./Setter>
</Style>