Click here to Skip to main content
15,897,371 members
Home / Discussions / WPF
   

WPF

 
QuestionDebug/Troubleshoot WPF Binding settings Pin
BRShroyer2-Aug-10 18:31
BRShroyer2-Aug-10 18:31 
AnswerRe: Debug/Troubleshoot WPF Binding settings Pin
Abhinav S3-Aug-10 17:04
Abhinav S3-Aug-10 17:04 
GeneralRe: Debug/Troubleshoot WPF Binding settings Pin
BRShroyer4-Aug-10 3:47
BRShroyer4-Aug-10 3:47 
GeneralRe: Debug/Troubleshoot WPF Binding settings Pin
Abhinav S4-Aug-10 18:25
Abhinav S4-Aug-10 18:25 
QuestionWPF for Windows CE 6.0 Pin
kiranpmody2-Aug-10 9:34
kiranpmody2-Aug-10 9:34 
AnswerRe: WPF for Windows CE 6.0 Pin
Pete O'Hanlon2-Aug-10 9:40
mvePete O'Hanlon2-Aug-10 9:40 
GeneralRe: WPF for Windows CE 6.0 Pin
kiranpmody2-Aug-10 9:48
kiranpmody2-Aug-10 9:48 
QuestionCannot find governing FrameworkElement or FrameworkContentElement Pin
stofel2-Aug-10 4:15
stofel2-Aug-10 4:15 
Hi,

I'm a newbie in wpf and I have a problem with the binding.

I have a class inherited from FramworkElement and there is a Collection. The Items of this collection are inherited from DependencyObject.

On the Form is only one TextBox. I want that the text, which is typed by the user will be copied into the first Item of the collection.

Here some code
public class Item: DependencyObject
    {
        public string Name { get; set; }

          public virtual object Value {
            get { return GetValue(ValueProperty); }
            set { SetValue(ValueProperty, value); }
        }

        #region DependenvyProperty
          public static readonly DependencyProperty ValueProperty =
              DependencyProperty.Register("Value", typeof(object), typeof(Item));
        #endregion

    }

    public class ItemContainer : FrameworkElement
    {
       
        private List<Item> _itemlist = new List<Item>();

        public List<Item> ItemList
        {
            get { return _itemlist; }
        }
    }


and the form:

Window x:Class="WpfApplication2.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="417" Width="589" xmlns:my="clr-namespace:WpfApplication2">
    <Grid>
        <my:ItemContainer Height="18" HorizontalAlignment="Left" Margin="-168,0,0,33" x:Name="itemContainer1" VerticalAlignment="Bottom" Width="18">
            <my:ItemContainer.ItemList>
                <my:Item Name="Item1" Value="{Binding ElementName=txtItem1, Path=Text}" />
                <my:Item Name="Item2" />
            </my:ItemContainer.ItemList>
        </my:ItemContainer>
        <Canvas Margin="16,18,8,6" Name="canvas1">
            <TextBox Canvas.Left="88" Canvas.Top="15" Height="23" Name="txtitem1" Width="89" />
            <Label Canvas.Left="14" Canvas.Top="16" Height="22" Name="label1" Width="58">Item1
            </Label>
        </Canvas>
    </Grid>
</Window>


At runtime the program displays the error2 Cannot find governing FrameworkElement or FrameworkContentElement.
I don't want to inherit item from FrameworkelElement because in the real project the class Item is inherited from another class.

What can I do to transfer the text from the textbox to the first item of the collection ?

Thanks in Advance
Willibert Stofel
QuestionAre there any benchmarks available for measuring general WPF performance on different systems? Pin
Erik2-Aug-10 3:11
Erik2-Aug-10 3:11 
QuestionStrange error occures after writting (seemingly) working piece of xaml code in a WPF application. IDE=Visual Studio 2010 Pin
makumazan842-Aug-10 2:40
makumazan842-Aug-10 2:40 
QuestionWPF - Popup moveable? Pin
devvvy1-Aug-10 15:53
devvvy1-Aug-10 15:53 
AnswerRe: WPF - Popup moveable? Pin
Abhinav S1-Aug-10 17:11
Abhinav S1-Aug-10 17:11 
GeneralRe: WPF - Popup moveable? Pin
devvvy2-Aug-10 21:29
devvvy2-Aug-10 21:29 
QuestionVisual State Manager - What's Wrong? Pin
#realJSOP31-Jul-10 10:16
professional#realJSOP31-Jul-10 10:16 
AnswerRe: Visual State Manager - What's Wrong? Pin
Abhinav S31-Jul-10 20:35
Abhinav S31-Jul-10 20:35 
GeneralRe: Visual State Manager - What's Wrong? Pin
#realJSOP1-Aug-10 1:34
professional#realJSOP1-Aug-10 1:34 
AnswerRe: Visual State Manager - What's Wrong? Pin
Abhinav S1-Aug-10 4:01
Abhinav S1-Aug-10 4:01 
QuestionFilling out extent of margins. Pin
dbrenth29-Jul-10 9:16
dbrenth29-Jul-10 9:16 
AnswerRe: Filling out extent of margins. Pin
dbrenth29-Jul-10 9:18
dbrenth29-Jul-10 9:18 
GeneralRe: Filling out extent of margins. Pin
BRShroyer29-Jul-10 9:30
BRShroyer29-Jul-10 9:30 
GeneralRe: Filling out extent of margins. Pin
dbrenth29-Jul-10 9:32
dbrenth29-Jul-10 9:32 
AnswerRe: Filling out extent of margins. Pin
BRShroyer29-Jul-10 9:26
BRShroyer29-Jul-10 9:26 
QuestionCreating a Binding Resource Pin
BRShroyer29-Jul-10 8:20
BRShroyer29-Jul-10 8:20 
AnswerRe: Creating a Binding Resource Pin
Abhishek Sur29-Jul-10 10:17
professionalAbhishek Sur29-Jul-10 10:17 
QuestionBinding xaml property to class property Pin
#realJSOP29-Jul-10 5:15
professional#realJSOP29-Jul-10 5:15 

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.