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

WPF

 
AnswerRe: Binding property from XML file data Pin
abollmeyer21-Jan-14 14:44
abollmeyer21-Jan-14 14:44 
QuestionCombobox / Textblock field Pin
eddieangel21-Jan-14 6:24
eddieangel21-Jan-14 6:24 
AnswerRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 7:52
professionalJason Gleim21-Jan-14 7:52 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 8:07
eddieangel21-Jan-14 8:07 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 8:48
professionalJason Gleim21-Jan-14 8:48 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 9:14
eddieangel21-Jan-14 9:14 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 9:42
professionalJason Gleim21-Jan-14 9:42 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 10:12
eddieangel21-Jan-14 10:12 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 10:25
professionalJason Gleim21-Jan-14 10:25 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 11:29
eddieangel21-Jan-14 11:29 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim22-Jan-14 4:28
professionalJason Gleim22-Jan-14 4:28 
GeneralRe: Combobox / Textblock field Pin
eddieangel22-Jan-14 5:34
eddieangel22-Jan-14 5:34 
QuestionHow to stop repeating animation Pin
Member 1001614016-Jan-14 12:25
Member 1001614016-Jan-14 12:25 
AnswerRe: How to stop repeating animation Pin
Varsha Ramnani20-Jan-14 22:41
professionalVarsha Ramnani20-Jan-14 22:41 
QuestionWPF Checkbox Binding Question Pin
Kevin Marois10-Jan-14 8:38
professionalKevin Marois10-Jan-14 8:38 
AnswerRe: WPF Checkbox Binding Question Pin
Meshack Musundi12-Jan-14 8:28
professionalMeshack Musundi12-Jan-14 8:28 
AnswerRe: WPF Checkbox Binding Question Pin
eddieangel21-Jan-14 7:53
eddieangel21-Jan-14 7:53 
QuestionVS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 4:47
Anthony.Canossi9-Jan-14 4:47 
AnswerRe: VS2013: cannot locate resource Pin
Mycroft Holmes9-Jan-14 11:49
professionalMycroft Holmes9-Jan-14 11:49 
GeneralRe: VS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 21:25
Anthony.Canossi9-Jan-14 21:25 
GeneralRe: VS2013: cannot locate resource Pin
Mycroft Holmes9-Jan-14 21:37
professionalMycroft Holmes9-Jan-14 21:37 
GeneralRe: VS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 22:28
Anthony.Canossi9-Jan-14 22:28 
AnswerRe: VS2013: cannot locate resource Pin
Meshack Musundi12-Jan-14 7:53
professionalMeshack Musundi12-Jan-14 7:53 
GeneralRe: VS2013: cannot locate resource Pin
Anthony.Canossi12-Jan-14 21:31
Anthony.Canossi12-Jan-14 21:31 
QuestionDragging A Control - Problem Pin
Kevin Marois8-Jan-14 10:13
professionalKevin Marois8-Jan-14 10:13 
I am trying to create a UI where I can move objects around. At the same time I need to be able to interact with the objects.

I am following this example[^].

I have looked at this many times before, and it get confusing, but I do understand some of it.

So far I have this:

<Window.Resources>
    <ResourceDictionary>
            
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="..\AppResources.xaml"/>
        </ResourceDictionary.MergedDictionaries>

        <!-- MoveThumb Template -->
        <ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type classes:MoveThumb}">
            <Rectangle Fill="Transparent"/>
        </ControlTemplate>

        <!-- ResizeDecorator Template -->
        <ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}">
            <Grid>
                <classes:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0" VerticalAlignment="Top" HorizontalAlignment="Stretch"/>
                <classes:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0" VerticalAlignment="Stretch" HorizontalAlignment="Left"/>
                <classes:ResizeThumb Width="3" Cursor="SizeWE" Margin="0 0 -4 0" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
                <classes:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 0 0 -4" VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/>
                <classes:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="-6 -6 0 0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                <classes:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="0 -6 -6 0" VerticalAlignment="Top" HorizontalAlignment="Right"/>
                <classes:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="-6 0 0 -6" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                <classes:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="0 0 -6 -6" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
            </Grid>
        </ControlTemplate>


        <!-- Designer Item Template-->
        <ControlTemplate x:Key="DesignerItemTemplate" TargetType="ContentControl">
            <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                <classes:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/>
                <Control Template="{StaticResource ResizeDecoratorTemplate}"/>
                <ContentPresenter Content="{TemplateBinding ContentControl.Content}"/>
            </Grid>
        </ControlTemplate>
            
    </ResourceDictionary>

</Window.Resources>
<Canvas Grid.Row="2"
            Grid.Column="0"
            Background="Transparent">

    <ContentControl Name="DesignerItem"
                        Width="100"
                        Height="100"
                        Canvas.Top="100"
                        Canvas.Left="100"
                        Template="{StaticResource DesignerItemTemplate}">

        <TextBox Grid.Row="1"
                    IsHitTestVisible="False"
                    Text="This is some text"
                    Height="Auto">

        </TextBox>

    </ContentControl>

</Canvas>


When I run it, I see Resize handles on all 4 corners of the textbox, and I can click & drag. The problem is that I cannot edit the text in the text box because the IsHitTestVisible property on the textbox Is False.

Set IsHitTestVisible = true and you can no longer drag & resize.

What I'd like is to be able to both drag/drop AND edit.

Can anyone help?

Thanks
If it's not broken, fix it until it is

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.