contentcontrol

Why would ItemsControl show a view but ContentControl show nothing?

I've got an application based on Prism. This is my shell: <Window x:Class="AvarioCRM3.ShellV2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" > <DockPanel LastChildFill="True"> <Border ...

Display a default DataTemplate in a ContentControl when its content is null or empty?

I would think this is possible, but the obvious way isn't working. Currently, I'm doing this: <ContentControl Content="{Binding HurfView.EditedPart}"> <ContentControl.Resources> <Style TargetType="ContentControl" x:Key="emptytemplate"> <Style.Triggers> <DataTrigger ...

jQuery Tabs with Masterpage - space between tabs and tab content

I'm trying use jQueryUI tabs in a content control. The code below works on a page that doesn't use a MasterPage. When I use it in a content control there is a large gray space between the tabs and the content in them. How do I get rid of this? I'm using jquery calendars and accordions with no problems in the content pages. There is...

With WPF, how to link an animation with a ContentControl?

I don't know how to link successfully a StoryBoard to a TranslateTransform that is part of a ContentControl. I always get the following error when I try to run my StoryBoard: 'RenderTransform' property does not point to a DependencyObject in path '(Children).[0].(Content).(0).(1)'. I guess I don't know how to define a TargetPropert...

WPF - Prism - Activate and Deactivate views in a ContentControl region

Hi, In my application I only need one view visible at a time which is why I am using a ContentControl in my shell. The issue is that if I have one view visible (lets say View1) and I activate View2, everything is fine up to this point. Now the user presses the Close button on View2 after which the users end up looking at a blank screen ...

Set <asp:content> content in C#

Hi there! I'm currently learning to use MasterPages and ContentPlaceHolders in ASP.NET 3.5 and C# - and right now, I'm desperately trying to edit the contents of an asp:Content-Control through my programming code. Background is this; As soon as a Button is pressed, I want the asp:Content to be cleared and filled with dynamic generated ...

Code for adding Content Controls Word 2007 C#

Hey all, I was wondering if anyone has any idea how I can add Content Controls to a Word Document (Office 2007) from the Document Task/Action Pane via C#. The goal is the following: I want to have categorized information in the Task/Action Pane and have the user fill out the info there. Once they have filled out that information they...

Render a content control in another tab of TabControl

I have a program wherein there are multiple tabs added dynamically to a TabControl object programmatically. What I want to do is render the Content value of each of these tabs to a PNG. I am using a script I picked up elsewhere on StackOverflow or perhaps Google (lost the source). My code looks like this: if (tabPanel.Items.Count > 0) {...

Explicitly refresh DataTemplate from a DataTemplateSelector?

Hello. I set up a ContentControl.DataTemplateSelector to my desired one. I want that according to a command or whatever, call the ContentControl to reselect the template from the selector by either xaml or code. Thank ...

Unable to set ContentTemplate via DataTrigger.

I want the ContentTemplate to vary according to the value in the DataTrigger. And yes, I considered using a DataTemplateSelector, but now I need a DataTrigger or better said a MultiDataTrigger. Please take a look at the following sampe app, the DataTemplate doesn't change: <Window x:Class="Window1" xmlns="http://schemas.microsoft.co...

ContentControl + RenderTargetBitmap + empty image

Im trying to create some chart images without ever displaying those charts on the screen. I'v been at this for quite a while and tried a lot of different things but nothing seems to work. The code works perfectly if I display the chart in a window first, but if I don't display it in a window, the bitmap is just white with a black border ...

MVVM/WPF: DataTemplate is not changed in Wizard

Hello, I wonder why my contentcontrol(headeredcontentcontrol) does not change the datatemplates when I press the previous/next button. While debugging everything seems ok means I jump forth and back the collection of wizardpages but always the first page is shown and its header text not the usercontrol is visible. What do I have forgot...

Open XML document ContentControls problem with signed id's

I have an application that generates Open XML documents with Content Controls. To create a new Content Control I use Interop and the method ContentControls.Add. This method returns an instance of the added Content Control. I have some logic that saves the id of the Content Control to reference it later, but in some computers I've been ...

Inserting a ContentControl after another ContentControl

In our VSTO Word 2010 Addin, we are trying to insert a RichTextControl after a given other ContentControl. We have tried this: public ContentControl AddContentControl(WdContentControlType type, int position) { Paragraph paragraphBefore = null; if (position == 0) { if (WordDocument.Paragraphs.C...

DataTemplate defautl visibility for ContentControls

In my MVVM based WPF application I have a lot of different ViewModel types that dynamically loaded into ContentControls or ContentPresenters. Therefor I need to explictly set what DataTemplate is to be used in XAML: <ContentControl Content={Binding SomePropertyOfTypeViewModel} ContentTemplate={StaticResource someTemplate} /> Now my pro...

Auto RowDefinitions Grid with ContentControls

Hi all, I have a Page with two ContentControls loaded by a RegionManager. A List of items, and a DetailView of these items. The problem is that the grid doesn't apply the auto height what I liked to. So I want to make all the available screen size to grid.row=0. I've added my code below: <Grid> <Grid.RowDefinitions> <RowDef...

Two-way binding on a ContentControl

I'm creating a Key/Value pair editor and would like for the value to have a custom template based on the data type. <TextBox x:Uid="txtKey" x:Name="txtKey" Grid.Column="1" Grid.Row="0" Text="{Binding ElementName=This, Path=KeyValuePair.Key}" VerticalAlignment="Top"/> <ContentControl Grid.Column="1" Grid.Row="1" x:Uid="Conten...

WPF DataGrid vertical sizing

I want to place a DataGrid inside a HeaderedContentControl but the the DataGrid does not get a vertical Scrollbar. It appears to be sized to hold all rows at once, the bottom disappearing from view. If I place the same DataGrid in a Border elelemnt I do get the behaviour I want. I have reduced it to this minimal example: <Grid> ...

Control's parent is null when placed inside a ContentControl

I've got a simple control derived from ContentControl with 3 properties. My problem comes when I try to perform a control.TransformToVisual() with a control that is placed inside MainContent. It always brings up an ArgumentNullException. My guess is this due to the control having a null Parent property. Is there a simple way to way aro...

Cannot turn off Design Mode in Word VBA

I'm stumped about this thing - when recording a macro where I basically add some fields and go into Design Mode to be able to replace the dummy text of the placeholder. Now, I go out of Design Mode when recording the macro and everything seems to be working ok. But when playing the macro, it just stops after ActiveDocument.ToggleFormsDes...