Click here to Skip to main content
15,922,145 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: color of wpf listview column Pin
C#_Programmer24-Jul-08 8:32
C#_Programmer24-Jul-08 8:32 
GeneralRe: color of wpf listview column Pin
Pete O'Hanlon24-Jul-08 8:53
mvePete O'Hanlon24-Jul-08 8:53 
GeneralRe: color of wpf listview column Pin
Jammer24-Jul-08 22:52
Jammer24-Jul-08 22:52 
GeneralRe: color of wpf listview column Pin
Pete O'Hanlon24-Jul-08 23:59
mvePete O'Hanlon24-Jul-08 23:59 
GeneralRe: color of wpf listview column Pin
Jammer25-Jul-08 0:16
Jammer25-Jul-08 0:16 
QuestionSession state maintanace in wpf browser application Pin
puneet.priyadarshi23-Jul-08 20:35
puneet.priyadarshi23-Jul-08 20:35 
AnswerRe: Session state maintanace in wpf browser application Pin
John_Adams24-Jul-08 23:38
John_Adams24-Jul-08 23:38 
QuestionUser Control inside other User Control problem Pin
edu_fidi23-Jul-08 20:07
edu_fidi23-Jul-08 20:07 
Hi...i'm new to wpf.
I have a problem and i dont find a solution on web.

I have an usercontrol (name PresenterControl.xaml) used as a container for other usercontrols (WindowContainerControl.xaml in this case). From code i think you'll understand what i;m trying to do.

The content of PresenterControl it;s a label. this content will be forwarded inside PresenterContent to WindowContainerControl. WindowContainerControl will put it inside a grid.

i;m getting this error and i have no solution in mind.
Key cannot be null.
Parameter name: key
at System.Collections.Specialized.ListDictionary.get_Item(Object key)
at System.Collections.Specialized.HybridDictionary.get_Item(Object key)
at System.Windows.StyleHelper.QueryChildIndexFromChildName(String childName, HybridDictionary childIndexFromChildName)

please help me if this issue can be solved and if i;m not asking too much please modify my example if you find a solution. thanks a lot.

Window1.xaml
<window x:class="WpfApplication3.Window1" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myControls="clr-namespace:WpfApplication3"
Title="Window1" Height="300" Width="300"&gt;
<grid>
<mycontrols:presentercontrol xmlns:mycontrols="#unknown">
<label>Label text</label>
</mycontrols:presentercontrol>
</grid>
</window>

PresenterControl.xaml
<usercontrol x:class="WpfApplication3.PresenterControl" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myControls="clr-namespace:WpfApplication3"
Height="300" Width="300"&gt;
<usercontrol.contenttemplate>
<datatemplate>
<grid>
<border background="Black" height="30" verticalalignment="Top" />
<mycontrols:windowcontainercontrol xmlns:mycontrols="#unknown">
<contentpresenter margin="3" content="{TemplateBinding Property=Content}" />
</mycontrols:windowcontainercontrol>
</grid>
</datatemplate>
</usercontrol.contenttemplate>
</usercontrol>

WindowContainerControl.xaml
<usercontrol x:class="WpfApplication3.WindowContainerControl" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300"&gt;
<usercontrol.contenttemplate>
<datatemplate>
<grid>
<grid.rowdefinitions>
<rowdefinition height="20" />
<rowdefinition height="*" />
</grid.rowdefinitions>
<!-- Butoanele ferestrei -->
<border background="Red" grid.row="0" cornerradius="5,5,0,0">
<grid>

</grid>
</border>
<border background="Blue" grid.row="1" cornerradius="5,5,0,0">
<grid>
<contentpresenter margin="3" content="{TemplateBinding Property=Content}" />
</grid>
</border>
</grid>
</datatemplate>
</usercontrol.contenttemplate>
</usercontrol>
AnswerRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 11:49
Jammer24-Jul-08 11:49 
GeneralRe: User Control inside other User Control problem Pin
edu_fidi24-Jul-08 12:01
edu_fidi24-Jul-08 12:01 
GeneralRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 12:30
Jammer24-Jul-08 12:30 
GeneralRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 12:42
Jammer24-Jul-08 12:42 
GeneralRe: User Control inside other User Control problem Pin
edu_fidi24-Jul-08 13:10
edu_fidi24-Jul-08 13:10 
QuestionProblems with scaling and stretching objects... Pin
gethomast23-Jul-08 9:52
gethomast23-Jul-08 9:52 
AnswerRe: Problems with scaling and stretching objects... Pin
Jammer23-Jul-08 11:48
Jammer23-Jul-08 11:48 
GeneralRe: Problems with scaling and stretching objects... Pin
gethomast23-Jul-08 20:24
gethomast23-Jul-08 20:24 
GeneralRe: Problems with scaling and stretching objects... Pin
Jammer23-Jul-08 23:59
Jammer23-Jul-08 23:59 
GeneralRe: Problems with scaling and stretching objects... Pin
Jammer24-Jul-08 0:30
Jammer24-Jul-08 0:30 
GeneralRe: Problems with scaling and stretching objects... Pin
gethomast24-Jul-08 2:10
gethomast24-Jul-08 2:10 
QuestionUserControl = DataTemplate!! [modified] Pin
Jammer23-Jul-08 3:04
Jammer23-Jul-08 3:04 
AnswerRe: UserControl = DataTemplate!! Pin
Pete O'Hanlon23-Jul-08 4:06
mvePete O'Hanlon23-Jul-08 4:06 
GeneralRe: UserControl = DataTemplate!! Pin
Jammer23-Jul-08 5:51
Jammer23-Jul-08 5:51 
QuestionAccessing values of Xaml controls in the web site Pin
ACMA_198022-Jul-08 22:06
ACMA_198022-Jul-08 22:06 
AnswerRe: Accessing values of Xaml controls in the web site Pin
Michael Sync23-Jul-08 19:16
Michael Sync23-Jul-08 19:16 
QuestionWebCam & MicroPhone support in Silverlight 2.0 Beta 2.0 Pin
248912822-Jul-08 21:58
248912822-Jul-08 21:58 

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.