Click here to Skip to main content
15,887,746 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: VS2008 / SL3 / VB: Can't define xmlns element Pin
Ian Shlasko22-Nov-10 10:51
Ian Shlasko22-Nov-10 10:51 
GeneralRe: VS2008 / SL3 / VB: Can't define xmlns element Pin
#realJSOP23-Nov-10 3:20
mve#realJSOP23-Nov-10 3:20 
GeneralRe: VS2008 / SL3 / VB: Can't define xmlns element Pin
Ian Shlasko23-Nov-10 3:23
Ian Shlasko23-Nov-10 3:23 
GeneralRe: VS2008 / SL3 / VB: Can't define xmlns element Pin
#realJSOP23-Nov-10 10:04
mve#realJSOP23-Nov-10 10:04 
QuestionPopup from DataGrid cell - how to anchor to cell's upper left corner? Pin
devvvy22-Nov-10 3:48
devvvy22-Nov-10 3:48 
AnswerRe: Popup from DataGrid cell - how to anchor to cell's upper left corner? Pin
Abhinav S22-Nov-10 4:14
Abhinav S22-Nov-10 4:14 
AnswerRe: Popup from DataGrid cell - how to anchor to cell's upper left corner? Pin
#realJSOP22-Nov-10 5:24
mve#realJSOP22-Nov-10 5:24 
GeneralRe: Popup from DataGrid cell - how to anchor to cell's upper left corner? Pin
devvvy22-Nov-10 21:54
devvvy22-Nov-10 21:54 
Thanks - I thought of routed event+dependency property. But not familiar enough to wire things up. I think following is my problem.

From my page's xaml.cs, I launched the popup everytime grid cell's content changes...
private void CntPropGrid_CellChanged(object sender, CellChangedEventArgs e)
{
...
    SomePopup.IsOpen = true;
    GeneralTransform transform = e.Editor.TransformToAncestor(CntPropGrid);
    Point rootPoint = transform.Transform(new Point(0, 0));
    SomePopup.PlacementRectangle = new Rect(rootPoint, new Size(200, 25));
    SomePopup.Visibility = Visibility.Visible;
    SomePopup.Width = 210;
    SomePopup.Height = 30;
    Result = SomeDialog.ShowHandlerDialog(e.Cell.Value.ToString());
    SomePopup.IsOpen = false;
    SomePopup.Visibility = Visibility.Collapsed;
    SomePopup.Width = 1;
    SomePopup.Height = 1;

    SomeEditPlacementRect = CellEditPopup.PlacementRectangle; // Newly added
...
}


I've now added dependency property, and corresponding CLR property wrapper:
public static DependencyProperty SomeEditPlacementRectProperty;

public Rect SomeEditPlacementRect
{
    get
    {
        return (Rect)GetValue(ConstraintSettings.SomeEditPlacementRectProperty);
    }

    set
    {
        SetValue(ConstraintSettings.SomeEditPlacementRectProperty, value);
    }
}

What I'm unsure of, is how to modify my xaml to wire up the separate parts ... so when grid cell location moves, popup changes accordingly.

<Popup
Name="SomeEditPopup"
Placement="Relative"
PlacementTarget="{Binding ElementName=SomeEntityGrid}"
IsOpen="False"
StaysOpen="true"
AllowsTransparency="True"
Visibility="Collapsed"
>
<StackPanel>
<myns:SomeUserControl x:Name="SomeDialog" ></myns:SomeUserControl>
</StackPanel>
</Popup>

First off, what "event" should I be using...? It's definitely not "MouseOver" on grid cell's parent data grid (as mouse over gets triggered all the time and does not equal parent window getting moved around). But in any case, final xaml should use routed event which resembles following?

<Popup
Name="SomeEditPopup"
Placement="Relative"
PlacementTarget="{Binding ElementName=SomeEntityGrid}"
IsOpen="False"
StaysOpen="true"
AllowsTransparency="True"
Visibility="Collapsed"
>
<Style.Triggers>
<Trigger Property="(QUESTION 1) $WHATEVENT$" Value="True">
<Setter Property="PlacementTarget" Value="(QUESTION 2) $WHATTOPUTHERE$" />
</Trigger>
</Style.Triggers>
<StackPanel>
<myns:SomeUserControl x:Name="SomeDialog" ></myns:SomeUserControl>
</StackPanel>
</Popup>

REF: WPF Concepts - routed events[^]
dev

Questionwhich one to select in these following option Pin
vinu.111121-Nov-10 20:20
vinu.111121-Nov-10 20:20 
AnswerRe: which one to select in these following option Pin
Mycroft Holmes21-Nov-10 20:55
professionalMycroft Holmes21-Nov-10 20:55 
AnswerRe: which one to select in these following option Pin
Abhinav S21-Nov-10 20:56
Abhinav S21-Nov-10 20:56 
QuestionQuest: Werid selection bug for duplicate item in WPF listview Pin
zeuscoder2012@gmail.com21-Nov-10 7:29
zeuscoder2012@gmail.com21-Nov-10 7:29 
QuestionChildren in reverse order, add to the Grid Pin
rus20420-Nov-10 17:19
rus20420-Nov-10 17:19 
AnswerRe: Children in reverse order, add to the Grid Pin
Mycroft Holmes20-Nov-10 21:21
professionalMycroft Holmes20-Nov-10 21:21 
GeneralRe: Children in reverse order, add to the Grid Pin
rus20420-Nov-10 23:00
rus20420-Nov-10 23:00 
GeneralRe: Children in reverse order, add to the Grid Pin
Mycroft Holmes20-Nov-10 23:47
professionalMycroft Holmes20-Nov-10 23:47 
GeneralRe: Children in reverse order, add to the Grid Pin
rus20421-Nov-10 3:19
rus20421-Nov-10 3:19 
GeneralRe: Children in reverse order, add to the Grid Pin
Pete O'Hanlon21-Nov-10 4:44
mvePete O'Hanlon21-Nov-10 4:44 
AnswerRe: Children in reverse order, add to the Grid Pin
Abhinav S20-Nov-10 23:42
Abhinav S20-Nov-10 23:42 
GeneralRe: Children in reverse order, add to the Grid Pin
rus20421-Nov-10 3:36
rus20421-Nov-10 3:36 
AnswerRe: Children in reverse order, add to the Grid Pin
Abhinav S21-Nov-10 5:57
Abhinav S21-Nov-10 5:57 
QuestionVB.Net/Silverlight Namespace(?) Issue [UPDATED] Pin
#realJSOP19-Nov-10 4:05
mve#realJSOP19-Nov-10 4:05 
AnswerRe: VB.Net/Silverlight Namespace(?) Issue Pin
Abhinav S20-Nov-10 2:09
Abhinav S20-Nov-10 2:09 
GeneralRe: VB.Net/Silverlight Namespace(?) Issue Pin
#realJSOP20-Nov-10 4:12
mve#realJSOP20-Nov-10 4:12 
AnswerRe: VB.Net/Silverlight Namespace(?) Issue Pin
_Maxxx_21-Nov-10 15:04
professional_Maxxx_21-Nov-10 15:04 

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.