Click here to Skip to main content
15,388,904 members
Home / Discussions / WPF
   

WPF

 
QuestionVS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 4:47
MemberAnthony.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
MemberAnthony.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
MemberAnthony.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
MemberAnthony.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

AnswerRe: Dragging A Control - Problem Pin
Meshack Musundi12-Jan-14 7:58
professionalMeshack Musundi12-Jan-14 7:58 
Questionupdate linq query result Pin
amigoface5-Jan-14 3:12
Memberamigoface5-Jan-14 3:12 
QuestionLearn Wpf Pin
Member 105030394-Jan-14 2:00
MemberMember 105030394-Jan-14 2:00 
AnswerRe: Learn Wpf Pin
Peter Leow4-Jan-14 2:16
professionalPeter Leow4-Jan-14 2:16 
AnswerRe: Learn Wpf Pin
Richard MacCutchan4-Jan-14 2:34
mveRichard MacCutchan4-Jan-14 2:34 
QuestionData Template Checkbox Binding Question Pin
Kevin Marois2-Jan-14 7:16
professionalKevin Marois2-Jan-14 7:16 
AnswerRe: Data Template Checkbox Binding Question Pin
Wayne Gaylard2-Jan-14 19:21
professionalWayne Gaylard2-Jan-14 19:21 
GeneralRe: Data Template Checkbox Binding Question Pin
Kevin Marois10-Jan-14 10:50
professionalKevin Marois10-Jan-14 10:50 
GeneralRe: Data Template Checkbox Binding Question Pin
Wayne Gaylard11-Jan-14 4:43
professionalWayne Gaylard11-Jan-14 4:43 
QuestionConvert xaml to C# Pin
Member 104997162-Jan-14 6:53
MemberMember 104997162-Jan-14 6:53 
SuggestionRe: Convert xaml to C# Pin
BenScharbach14-Oct-17 9:45
MemberBenScharbach14-Oct-17 9:45 
QuestionWPF DialogService Question Pin
Kevin Marois29-Dec-13 11:31
professionalKevin Marois29-Dec-13 11:31 
AnswerRe: WPF DialogService Question Pin
veboys30-Dec-13 5:08
Memberveboys30-Dec-13 5:08 
GeneralRe: WPF DialogService Question Pin
Kevin Marois30-Dec-13 6:56
professionalKevin Marois30-Dec-13 6:56 
SuggestionRe: WPF DialogService Question Pin
Ron Beyer30-Dec-13 5:39
professionalRon Beyer30-Dec-13 5:39 
GeneralRe: WPF DialogService Question Pin
Kevin Marois30-Dec-13 6:56
professionalKevin Marois30-Dec-13 6:56 
GeneralRe: WPF DialogService Question Pin
Kevin Marois30-Dec-13 7:06
professionalKevin Marois30-Dec-13 7:06 

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.