设置命令绑定的目标 [英] Setting the target of a command binding

查看:45
本文介绍了设置命令绑定的目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我有一个wpf富文本框,我可以打开它并在Win32应用程序中显示它.

I have a wpf rich text box that I open and show in a win32 application.

我在资源字典中声明rtf框,如下所示:

I declare the rtf box in a resource dictionary like so:

 

 <RichTextBox 
  x:Key="rtfBox"
  HorizontalScrollBarVisibility="Auto" 
  VerticalScrollBarVisibility="Auto" 
  HorizontalAlignment="Stretch"
  VerticalAlignment="Stretch"
 </RichTextBox>

 

 

在另一个地方,我有一个wpf窗口,用作浮动工具栏.我用自己的xaml声明它,类似于以下内容:

In another place, I have a wpf window which I use as a floating tool bar. I declare it in its own xaml, similar to the following:

 

<Window x:Class="BidiFix.SandBox.Window1"
    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" 
    mc:Ignorable="d" 
 Title="Window1" AllowsTransparency="True" Focusable="False" ShowActivated="False" ShowInTaskbar="False"
  SizeToContent="Width" Height="24" Topmost="True" Padding="2"
  WindowStyle="None" Background="Transparent" >

  <Border>   
   <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="2">
    <Button Command="Copy" Context="Copy"/>
    <Button Command="Cut" Context="Cut"/>
    <Button Command="Paste" Context="Paste"/>
    </StackPanel>
  </Border>
 
</Window>

推荐答案

那么您的Win32应用程序是什么类型? MFC还是?

So what's the type of your Win32 application? MFC or?

谢谢,


这篇关于设置命令绑定的目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆