0606-PathGeometry prism RequestNavigate导航 ScrollViewer RichTextBox style

积善之家必有余庆,积恶之家必有余殃。

拥抱变化、抓住机遇、才能赢得未来。

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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值