Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF
I have the following code:
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <ContentControl x:Name="MainContent" Grid.Column="0">
        Some content
    </ContentControl>
    <GridSplitter Grid.Column="1" Width="5"/>
    <ContentControl Content="{Binding ElementName=MainContent, Path=Content}" Grid.Column="2"/>
</Grid>
 

This shows the content of the first ContentControl in both sides.
If I change the "Some content" text to any control it shows the content only in the second ContentControl and not in both.
 
Is there any way to do this?
Posted 5-Jun-13 20:46pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Itamarep at 9-Jun-13 8:40am
   
In my case, I want to display 2 web browsers that will display the same content and when browsing in one it will show the same results in the other.
If I connect the source to a resource it will browse in both opening the same page twice, more than that, if an internal script on the page changes the display, the URL doesn't have to change meaning they will display different pages (under the same URL)
Sergey Alexandrovich Kryukov at 9-Jun-13 13:03pm
   
And how is that related to the original question?
OK, please see Solution 2 then.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The question asked in the comment to Solution 1 has nothing to do with the original question:
Itamarep asked:
In my case, I want to display 2 web browsers that will display the same content and when browsing in one it will show the same results in the other. If I connect the source to a resource it will browse in both opening the same page twice, more than that, if an internal script on the page changes the display, the URL doesn't have to change meaning they will display different pages (under the same URL)
System.Windows.Controls.WebBrowser is not System.Windows.Controls.ContentControl, and the media content it shows has nothing to do with the content of ContentControl:
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx[^].
 
Isn't the resolution of this problem, especially taken into account the last clause about the effect of the page's "internal script" trivial?
The browser URI is changed is 1) you navigate to some other URI using one of the Navigate methods; 2) when a use clicks in some HTML navigation control (such as anchor) inside the page currently rendered; in other way, you can navigate using some different URL from outside the browser's page and from the page. In first case, simply call the same Navigate method from both browser.
 
The second case is just a little bit different and asymmetric: handle the event Navigating in one browser instance, and, in its handler, call Navigate for another browser instance accordingly.
 
First and foremost, don't try to handle this event in both browsers in reciprocal manner, to avoid "infinite" mutual recursion: http://en.wikipedia.org/wiki/Mutual_recursion[^]… Smile | :)
 
—SA
  Permalink  
Comments
Itamarep at 10-Jun-13 1:18am
   
Having both browsers navigate to the same site is easy but is not enough, in the same site (exact same URI) you can have different contents which is something I don't want.
In addition, if I display a clip in one side I want to display the same clip at the exact same location in the other.
If there is a solution for that, please post it since I can't see it by using the same resource.
Sergey Alexandrovich Kryukov at 10-Jun-13 9:16am
   
You have made very vague comment on different content with the same URL when asking this question.
 
If you mean having the same content every second, not just the same URI, this is even theoretically impossible. Do I even have to explain why? it should be obvious.
 
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 9 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100