Click here to Skip to main content
15,899,475 members
Home / Discussions / WPF
   

WPF

 
QuestionSilverlight App versus Silverlight Busines App Pin
Kevin Marois24-Jan-12 8:09
professionalKevin Marois24-Jan-12 8:09 
AnswerRe: Silverlight App versus Silverlight Busines App Pin
Abhinav S25-Jan-12 0:45
Abhinav S25-Jan-12 0:45 
Questiondynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 22:37
Giorgi Nistor23-Jan-12 22:37 
AnswerRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 23:50
Giorgi Nistor23-Jan-12 23:50 
GeneralRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor25-Jan-12 4:07
Giorgi Nistor25-Jan-12 4:07 
QuestionMVVM architecture Pin
mi_n22-Jan-12 21:18
mi_n22-Jan-12 21:18 
AnswerRe: MVVM architecture Pin
Wayne Gaylard22-Jan-12 21:59
professionalWayne Gaylard22-Jan-12 21:59 
GeneralRe: MVVM architecture Pin
mi_n23-Jan-12 8:51
mi_n23-Jan-12 8:51 
Thanks for your help,
Can i use <x:code> in xaml for focusing on elements(like gridview) or getting the current item of a gridview or something like that in MVVM????


example:
viewmodel:
C#
void BnbankPreviewKeyDownCommandExecute(KeyEventArgs p)
        {
            var grd = (RadGridView)p.Source;
            var rowIndex = grd.Items.IndexOf(grd.SelectedItem);
            if (((Keyboard.Modifiers != ModifierKeys.Shift) & (p.Key == Key.Tab &               grd.CurrentColumn.DisplayIndex == grd.Columns.Count - 1)) || (p.Key == Key.Down))
            {
                if (rowIndex + 1 == grd.Items.ItemCount)
                {
                    if (p.Key == Key.Tab & grd.CurrentColumn.DisplayIndex == grd.Columns.Count -1)
                    {
                        p.Handled = true;
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.DOWN);
                    }
                    grd.CurrentCellInfo = new GridViewCellInfo(grd.Items[rowIndex], grd.Columns[0]);
                    grd.Focus();
                    grd.CommitEdit();
                    SaveBnbankCommandExecute(BnbankSelectedRow);
                    grd.BeginInsert();
                }
            }
         }




view(Xaml):
XML
<telerik:RadGridView x:Name="RadGridView1" ShowInsertRow="True"
                             ItemsSource="{Binding AllBnbanks}" SelectedItem="{Binding BnbankSelectedRow, Mode=TwoWay}"
                             CanUserFreezeColumns="False" AutoGenerateColumns="False" Height="300" CanUserInsertRows="True" ShowGroupPanel="False" FontFamily="Tahoma" FontSize="10" Margin="14,2,16,2">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="PreviewKeyDown">
                            <cmd:EventToCommand Command="{Binding Path=BnbankPreviewKeyDownCommand, Mode=Default,UpdateSourceTrigger=PropertyChanged}" PassEventArgsToCommand="True"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataType="{x:Null}" UniqueName="Bnba01"/>
                        <telerik:GridViewDataColumn DataType="{x:Null}" UniqueName="Bnba02"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

GeneralRe: MVVM architecture Pin
Dean Oliver23-Jan-12 18:35
Dean Oliver23-Jan-12 18:35 
GeneralRe: MVVM architecture Pin
mi_n24-Jan-12 21:03
mi_n24-Jan-12 21:03 
AnswerRe: MVVM architecture Pin
Dean Oliver25-Jan-12 19:35
Dean Oliver25-Jan-12 19:35 
Questionconnectionstring Pin
arkiboys20-Jan-12 1:10
arkiboys20-Jan-12 1:10 
SuggestionRe: connectionstring Pin
Dean Oliver27-Jan-12 22:33
Dean Oliver27-Jan-12 22:33 
GeneralRe: connectionstring Pin
arkiboys28-Jan-12 20:19
arkiboys28-Jan-12 20:19 
QuestionWPF Listbox items Pin
programmervb.netc++19-Jan-12 7:22
programmervb.netc++19-Jan-12 7:22 
AnswerRe: WPF Listbox items Pin
Dean Oliver23-Jan-12 19:02
Dean Oliver23-Jan-12 19:02 
QuestionHow to refer ViewModel from user-control code behind? Pin
sbkk16-Jan-12 11:54
sbkk16-Jan-12 11:54 
AnswerRe: How to refer ViewModel from user-control code behind? Pin
Mycroft Holmes16-Jan-12 13:07
professionalMycroft Holmes16-Jan-12 13:07 
AnswerRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon16-Jan-12 22:29
mvePete O'Hanlon16-Jan-12 22:29 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk17-Jan-12 4:59
sbkk17-Jan-12 4:59 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon17-Jan-12 5:21
mvePete O'Hanlon17-Jan-12 5:21 
JokeRe: How to refer ViewModel from user-control code behind? Pin
Tom Delany24-Jan-12 11:25
Tom Delany24-Jan-12 11:25 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
Pete O'Hanlon24-Jan-12 12:22
mvePete O'Hanlon24-Jan-12 12:22 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk19-Jan-12 5:20
sbkk19-Jan-12 5:20 
GeneralRe: How to refer ViewModel from user-control code behind? Pin
sbkk25-Jan-12 3:44
sbkk25-Jan-12 3:44 

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.