Click here to Skip to main content
15,889,877 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
Pete O'Hanlon24-Sep-13 5:44
mvePete O'Hanlon24-Sep-13 5:44 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
Kevin Marois24-Sep-13 5:45
professionalKevin Marois24-Sep-13 5:45 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
Pete O'Hanlon24-Sep-13 7:04
mvePete O'Hanlon24-Sep-13 7:04 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
SledgeHammer0124-Sep-13 8:21
SledgeHammer0124-Sep-13 8:21 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
Pete O'Hanlon24-Sep-13 8:24
mvePete O'Hanlon24-Sep-13 8:24 
GeneralRe: WPF MVVM Determine When Property On Model Changes Pin
Mycroft Holmes24-Sep-13 21:25
professionalMycroft Holmes24-Sep-13 21:25 
QuestionHow to create multi focus in Surface application so multiple users can use application togather on sur 40 Pin
sacpundir15-Sep-13 21:29
professionalsacpundir15-Sep-13 21:29 
Questiona question about MVVM Pin
lijizhe12-Sep-13 22:38
lijizhe12-Sep-13 22:38 
have used a RadTileView,
<usercontrol
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
="" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" x:class="DemoShow.usercontrol.UserControl1" mc:ignorable="d">
<usercontrol.resources>


<Style.Triggers>
<Trigger Property="IsEnabled" Value="true">
<Setter Property="BorderThickness" Value="1,1,1,1" />
</trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="BorderThickness" Value="0,0,0,0"/>
</trigger>
</style.Triggers>


<datatemplate x:key="headerTemplate">
<textblock text="{Binding Number}">

<datatemplate x:key="contentTemplate">
<grid margin="5">
<grid.rowdefinitions>
<rowdefinition height="Auto">
<rowdefinition height="Auto">
<rowdefinition height="Auto">
<rowdefinition height="Auto">
<rowdefinition height="Auto">
<rowdefinition height="Auto">
<rowdefinition height="Auto">

<textbox grid.row="0" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding Name,Mode=TwoWay}">
<textbox grid.row="1" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding Birthday,Mode=TwoWay}">
<textbox grid.row="2" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding age,Mode=TwoWay}">
<textbox grid.row="3" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding Sex,Mode=TwoWay}">
<textbox grid.row="4" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding CheckType,Mode=TwoWay}">
<textbox grid.row="5" style="{StaticResource TextBoxThumb}" isenabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" text="{Binding Time,Mode=TwoWay}">

<i:interaction.triggers>
<i:eventtrigger eventname="Click">
<i:invokecommandaction command="{Binding DataContext.LoginCommand,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}, AncestorLevel=1}}"
="" commandparameter="{Binding Name}">







<grid>
<telerik:radtileview
="" isautoscrollingenabled="True" isdockingenabled="True" isvirtualizing="True" columnscount="2" rowheight="200" columnwidth="300" minimizedcolumnwidth="300" minimizedrowheight="200" minimizeditemsposition="Bottom" contenttemplate="{StaticResource contentTemplate}" itemssource="{Binding Path=Items,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" itemtemplate="{StaticResource headerTemplate}" preservepositionwhenmaximized="False" tilestatechangetrigger="SingleClick">






i change the BindingList<people>

public class MainViewModel : ViewModelBase
{
private BindingList<people> items;
private BindingList<people> itemstem;

public ICommand LoginCommand
{
get
{
return new RelayCommand<object>(
(parameter) =>
{
ChangeInputEnable(parameter);
}
);
}
}

ui not update public class People
{
public string Name { get; set; }
public string Birthday { get; set;}
public string age { get; set; }
public string Sex { get; set; }
public string CheckType { get; set; }
public string Time { get; set; }
public string Number { get; set; }
public bool ShowFlag { get; set; }
}

private void ChangeInputEnable(object parameter)
{

//string str = parameter.ToString();
//var obj = items.FirstOrDefault(x => x.Name == str);
//int n = items.IndexOf(obj);
//MessageBox.Show(items[n].ShowFlag.ToString());
//if (obj != null)
//{
// if (obj.ShowFlag) obj.ShowFlag = false;
// else obj.ShowFlag = true;

// RaisePropertyChanged("ShowFlag");
// RaisePropertyChanged("Items");
// MessageBox.Show(items[n].ShowFlag.ToString());
// MessageBox.Show(str);
//}


string str = parameter.ToString();
var obj = items.FirstOrDefault(x => x.Name == str);
int n = items.IndexOf(obj);
if (obj != null)
{
if (obj.ShowFlag) obj.ShowFlag = false;
else obj.ShowFlag = true;
obj.Name += "tttt";
items.ListChanged += (o, e) => RaisePropertyChanged(("Items"));

itemstem = items;
items = null;
items = itemstem;
RaisePropertyChanged("Name");

RaisePropertyChanged("Items");
}


//items.Add(new People()
//{
// Birthday = "1985-08-08",
// age = "38",
// Sex = "Male",
// CheckType = "PET-CT",
// Time = "10:30",
// Name = "tttt",
// Number = "10"
//});

//RaisePropertyChanged("Items");


}

public MainViewModel()
{
List<people> itemsSource = new List<people>();
for (int i = 0; i < 5; i++)
{
itemsSource.Add(new People()
{
Birthday = "1985-08-08",
age = "38",
Sex = "Male",
CheckType = "PET-CT",
Time = "10:30",
Name = this.names[i % 12],
Number = i.ToString(),
ShowFlag =true
});
}

this.items = new BindingList<people>(itemsSource);
}


public BindingList<people> Items
{
get
{
return this.items;
}
set
{
this.items =value;
RaisePropertyChanged("Items");
}
}

private List<string> names = new List<string>
{
"Andrew Fuller",
"Martin Sommer",
"Anne Dogsworth",
"Steven Buchanan",
"Janet Leverling",
"Michael Suyama",
"Margaret Peacock",
"Robert King",
"John Steel",
"Laura Gallahan",
"Nancy Davolio",
"Ann Devon"
};
}

can you help me ?
AnswerRe: a question about MVVM Pin
Richard MacCutchan12-Sep-13 23:56
mveRichard MacCutchan12-Sep-13 23:56 
QuestionHow to create appointment in radscheduleview programatically from another window Pin
ramkie12-Sep-13 1:42
ramkie12-Sep-13 1:42 
AnswerRe: How to create appointment in radscheduleview programatically from another window Pin
Pete O'Hanlon12-Sep-13 2:55
mvePete O'Hanlon12-Sep-13 2:55 
QuestionWPF/MVVM App On WIndows 8 Tablet - Touch Doesn't Work Pin
Kevin Marois11-Sep-13 6:02
professionalKevin Marois11-Sep-13 6:02 
AnswerRe: WPF/MVVM App On WIndows 8 Tablet - Touch Doesn't Work Pin
Punamchand Dhuppad19-Sep-13 18:10
professionalPunamchand Dhuppad19-Sep-13 18:10 
QuestionWPF DataGrid with Bands Pin
Kevin Marois10-Sep-13 11:50
professionalKevin Marois10-Sep-13 11:50 
AnswerRe: WPF DataGrid with Bands Pin
SledgeHammer0110-Sep-13 13:23
SledgeHammer0110-Sep-13 13:23 
GeneralRe: WPF DataGrid with Bands Pin
Kevin Marois10-Sep-13 13:24
professionalKevin Marois10-Sep-13 13:24 
AnswerRe: WPF DataGrid with Bands Pin
Abhinav S10-Sep-13 16:57
Abhinav S10-Sep-13 16:57 
QuestionSave/Load view configuration to/from xml file Pin
columbos149278-Sep-13 2:23
columbos149278-Sep-13 2:23 
AnswerRe: Save/Load view configuration to/from xml file Pin
Mycroft Holmes10-Sep-13 15:06
professionalMycroft Holmes10-Sep-13 15:06 
AnswerRe: Save/Load view configuration to/from xml file Pin
Abhinav S10-Sep-13 16:59
Abhinav S10-Sep-13 16:59 
Questionquery using Lamda expression Pin
picasso27-Sep-13 19:26
picasso27-Sep-13 19:26 
AnswerRe: query using Lamda expression Pin
Matt T Heffron9-Sep-13 7:01
professionalMatt T Heffron9-Sep-13 7:01 
GeneralRe: query using Lamda expression Pin
picasso29-Sep-13 16:55
picasso29-Sep-13 16:55 
GeneralRe: query using Lamda expression Pin
Richard MacCutchan9-Sep-13 21:08
mveRichard MacCutchan9-Sep-13 21:08 
AnswerRe: query using Lamda expression Pin
koll Zhu22-Sep-13 23:43
koll Zhu22-Sep-13 23:43 

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.