Click here to Skip to main content
15,887,822 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Silverlight debugging question Pin
PumbaPumba27-Sep-10 19:16
PumbaPumba27-Sep-10 19:16 
AnswerRe: Silverlight debugging question Pin
Pete O'Hanlon27-Sep-10 23:02
mvePete O'Hanlon27-Sep-10 23:02 
GeneralRe: Silverlight debugging question Pin
Abhinav S28-Sep-10 2:26
Abhinav S28-Sep-10 2:26 
GeneralRe: Silverlight debugging question Pin
Pete O'Hanlon28-Sep-10 3:49
mvePete O'Hanlon28-Sep-10 3:49 
AnswerRe: Silverlight debugging question Pin
Kunal Chowdhury «IN»29-Sep-10 8:00
professionalKunal Chowdhury «IN»29-Sep-10 8:00 
QuestionBinding MenuItem.IsChecked to RichTextBox.SpellCheck.IsEnabled Pin
dani kenan27-Sep-10 3:42
dani kenan27-Sep-10 3:42 
AnswerRe: Binding MenuItem.IsChecked to RichTextBox.SpellCheck.IsEnabled Pin
PumbaPumba17-Oct-10 22:34
PumbaPumba17-Oct-10 22:34 
QuestionSetting the target of a command binding Pin
dani kenan27-Sep-10 3:35
dani kenan27-Sep-10 3:35 
Hi,

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

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

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


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>


I instantiate and show the window using the following code:

RichTextBox rtfBox = GetTheBox();
Window1 win = new Window1();
win.Show();


Now, as you can see I have both the rtf box and window available. But the window is not an ancestor of the rtfBox, nor do they share the same xaml.

What minimal markup and/or code is needed to connect the Clipboard commands and button states to the rtf box, such that they will reflect their availability based on the selection state in the rich text box and when click will operate on the rich text box.

Please help.

10x.
QuestionRichTexBox/FlowDocument Macro Recording Pin
dani kenan27-Sep-10 3:27
dani kenan27-Sep-10 3:27 
QuestionCanvas, dragging, scrollbars and measureoverride Pin
RugbyLeague26-Sep-10 23:09
RugbyLeague26-Sep-10 23:09 
AnswerRe: Canvas, dragging, scrollbars and measureoverride Pin
PumbaPumba27-Sep-10 19:41
PumbaPumba27-Sep-10 19:41 
GeneralRe: Canvas, dragging, scrollbars and measureoverride Pin
RugbyLeague27-Sep-10 21:39
RugbyLeague27-Sep-10 21:39 
QuestionDatagrid with Selected cell Pin
Saksida Bojan26-Sep-10 4:57
Saksida Bojan26-Sep-10 4:57 
AnswerRe: Datagrid with Selected cell Pin
Abhinav S26-Sep-10 5:36
Abhinav S26-Sep-10 5:36 
GeneralRe: Datagrid with Selected cell [modified] Pin
Saksida Bojan26-Sep-10 9:46
Saksida Bojan26-Sep-10 9:46 
QuestionProblems converting color image to grayscale [modified] Pin
Lenquist26-Sep-10 1:46
Lenquist26-Sep-10 1:46 
AnswerRe: Problems converting color image to grayscale Pin
Abhinav S26-Sep-10 7:23
Abhinav S26-Sep-10 7:23 
GeneralRe: Problems converting color image to grayscale Pin
Lenquist26-Sep-10 8:55
Lenquist26-Sep-10 8:55 
AnswerRe: Problems converting color image to grayscale Pin
Paul Daniel Ruston27-Sep-10 13:59
Paul Daniel Ruston27-Sep-10 13:59 
GeneralRe: Problems converting color image to grayscale Pin
Lenquist27-Sep-10 23:31
Lenquist27-Sep-10 23:31 
QuestionAnimating Object along PathGeometry + transformation Pin
DTh197823-Sep-10 16:04
DTh197823-Sep-10 16:04 
QuestionEfficient WPF drawing code Pin
astibich223-Sep-10 12:17
astibich223-Sep-10 12:17 
QuestionUnable to set focus to datepicker using attached property in wpf Pin
dashingsidds23-Sep-10 1:07
dashingsidds23-Sep-10 1:07 
AnswerRe: Unable to set focus to datepicker using attached property in wpf Pin
PumbaPumba27-Sep-10 20:02
PumbaPumba27-Sep-10 20:02 
QuestionCustom control resets font properties set through Xaml Pin
WebMaster22-Sep-10 21:36
WebMaster22-Sep-10 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.