锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲高清乱码午夜电影网,亚洲另类无码专区丝袜,亚洲另类古典武侠http://blogjava.net/crazycoding/category/54847.htmlGod helps those who help themselves. zh-cnMon, 04 Jan 2016 22:53:25 GMTMon, 04 Jan 2016 22:53:25 GMT60鍦╒iewModel閲屽浣曡幏寰楄View閲屾煇鎺т歡鐨勫紩鐢?/title><link>http://m.tkk7.com/crazycoding/archive/2015/06/19/425793.html</link><dc:creator>Ying-er</dc:creator><author>Ying-er</author><pubDate>Fri, 19 Jun 2015 04:24:00 GMT</pubDate><guid>http://m.tkk7.com/crazycoding/archive/2015/06/19/425793.html</guid><wfw:comment>http://m.tkk7.com/crazycoding/comments/425793.html</wfw:comment><comments>http://m.tkk7.com/crazycoding/archive/2015/06/19/425793.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/crazycoding/comments/commentRss/425793.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/crazycoding/services/trackbacks/425793.html</trackback:ping><description><![CDATA[涓ょ偣錛?br />①錛氱粰璇ユ帶浠惰搗涓钁╃偣鐨勫悕瀛楋紙鐩殑鏄笉瑕佷笌鍒殑鎺т歡閲嶅悕錛?br />②錛氬彨閱掍綘鐨勬帶浠訛紝瀵癸紝瀹冨氨鐫″湪<span style="font-size: 13px; background-color: #eeeeee;">Application.Current.Windows</span>閲岋紒<br />娉細璇ユ柟娉曟潃浼ゅ姏宸ㄥぇ錛屾湁鎮朚VVM璁捐鍒濊》錛屽簲灝介噺閬垮紑<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">                         </span><span style="color: #0000ff; background-color: yellow;">foreach</span><span style="background-color: yellow;"> (Window win </span><span style="color: #0000ff; background-color: yellow;">in</span><span style="background-color: yellow;"> Application.Current.Windows)</span><br />                        {<br />                            <span style="background-color: yellow;">dataGrid </span><span style="background-color: yellow;">=</span><span style="background-color: yellow;"> win.FindName(</span><span style="background-color: yellow;">"</span><span style="background-color: yellow;">_vwMarkDatagrid</span><span style="background-color: yellow;">"</span><span style="background-color: yellow;">) </span><span style="color: #0000ff; background-color: yellow;">as</span><span style="background-color: yellow;"> DataGrid;</span><br />                            <span style="color: #0000FF; ">if</span> (dataGrid != <span style="color: #0000FF; ">null</span> && selectMark.MarkID != currentMarkID)<br />                            {<br />                                isFromMap = <span style="color: #0000FF; ">true</span>;<br />                                currentMarkID = selectMark.MarkID;<br />                                <span style="background-color: #ffff99;">dataGrid.SelectedItem </span><span style="background-color: #ffff99;">=</span><span style="background-color: #ffff99;"> selectMark;</span><br />                                <span style="background-color: #ffff99;">dataGrid.ScrollIntoView(selectMark);</span><br /><br />                                <span style="color: #0000FF; ">break</span>;<br />                            }<br />                        }</div><img src ="http://m.tkk7.com/crazycoding/aggbug/425793.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/crazycoding/" target="_blank">Ying-er</a> 2015-06-19 12:24 <a href="http://m.tkk7.com/crazycoding/archive/2015/06/19/425793.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>WPF 濡備綍鍋囪涓嶆槸ListView鈥斺斿幓鍒楀ご錛屽幓楂樹寒http://m.tkk7.com/crazycoding/archive/2015/06/11/425614.htmlYing-erYing-erThu, 11 Jun 2015 03:08:00 GMThttp://m.tkk7.com/crazycoding/archive/2015/06/11/425614.htmlhttp://m.tkk7.com/crazycoding/comments/425614.htmlhttp://m.tkk7.com/crazycoding/archive/2015/06/11/425614.html#Feedback0http://m.tkk7.com/crazycoding/comments/commentRss/425614.htmlhttp://m.tkk7.com/crazycoding/services/trackbacks/425614.html                            <!--hide the header at the top of each grid column-->
                            <ListView.Resources>
                                <Style TargetType="GridViewColumnHeader">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </Style>
                            </ListView.Resources>
                            <!--Remove highlight effect from ListViewItem-->
                            <ListView.ItemContainerStyle>
                                <Style TargetType="{x:Type ListViewItem}">
                                    <Setter Property="Background" Value="Transparent" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListViewItem}">
                                                <Border BorderBrush="Transparent" 
                                                                    BorderThickness
="0" 
                                                                    Background
="{TemplateBinding Background}">
                                                    <GridViewRowPresenter 
                                                                    
HorizontalAlignment="Stretch" 
                                                                    VerticalAlignment
="{TemplateBinding VerticalContentAlignment}" 
                                                                    Width
="Auto" 
                                                                    Margin
="0,3,0,0" 
                                                                    Content
="{TemplateBinding Content}"/>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ListView.ItemContainerStyle>

Ying-er 2015-06-11 11:08 鍙戣〃璇勮
]]>
璇磋WPF ListView閲岀殑selected涓夊厔寮熲斺擲electedItem,SelectedValue,SelectedValuePathhttp://m.tkk7.com/crazycoding/archive/2015/06/11/425613.htmlYing-erYing-erThu, 11 Jun 2015 02:55:00 GMThttp://m.tkk7.com/crazycoding/archive/2015/06/11/425613.htmlhttp://m.tkk7.com/crazycoding/comments/425613.htmlhttp://m.tkk7.com/crazycoding/archive/2015/06/11/425613.html#Feedback0http://m.tkk7.com/crazycoding/comments/commentRss/425613.htmlhttp://m.tkk7.com/crazycoding/services/trackbacks/425613.html鍙洜鍦ㄥぇ鍚嶉紟榧庣殑stackoverflow涓婇亣鍒頒簡鐗涢煎搫鍝勭殑 Chris Anderson
涓嬮潰鎴戜滑鏉ョ湅鐪嬬墰浜烘槸鎬庢牱鐏溂閲戠潧璇嗙牬榪欎笁涓縐樺浼欑殑錛?br />浠ヤ笅鍐呭瀹屽叏杞嚜stackoverflow

Their names can be a bit confusing :). Here's a summary:

  • The SelectedItem property returns the entire object that your list is bound to. So say you've bound a list to a collection of Category objects (with each Category object having Name and ID properties). eg. ObservableCollection<Category>. The SelectedItem property will return you the currently selected Category object. For binding purposes however, this is not always what you want, as this only enables you to bind an entire Category object to the property that the list is bound to, not the value of a single property on that Category object (such as its ID property).

  • Therefore we have the SelectedValuePath property and the SelectedValue property as an alternative means of binding (you use them in conjunction with one another). Let's say you have aProduct object, that your view is bound to (with properties for things like ProductName, Weight, etc). Let's also say you have a CategoryID property on that Product object, and you want the user to be able to select a category for the product from a list of categories. You need the ID property of the Category object to be assigned to the CategoryID property on the Product object. This is where the SelectedValuePath and the SelectedValue properties come in. You specify that the ID property on the Category object should be assigned to the property on the Product object that the list is bound to using SelectedValuePath='ID', and then bind the SelectedValueproperty to the property on the DataContext (ie. the Product).

The example below demonstrates this. We have a ComboBox bound to a list of Categories (via ItemsSource). We're binding the CategoryID property on the Product as the selected value (using the SelectedValue property). We're relating this to the Category's ID property via the SelectedValuePath property. And we're saying only display the Name property in the ComboBox, with the DisplayMemberPath property).

<ComboBox ItemsSource="{Binding Categories}" 
          SelectedValue
="{Binding CategoryID, Mode=TwoWay}" 
          SelectedValuePath
="ID" 
          DisplayMemberPath
="Name" />

It's a little confusing initially, but hopefully this makes it a bit clearer... :)

Chris



















Ying-er 2015-06-11 10:55 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲成a人片在线观看无码| 国产精品无码免费播放| 亚洲午夜成人精品电影在线观看| jzzijzzij在线观看亚洲熟妇| 在线免费视频一区| 亚洲av日韩av永久在线观看| 日本一道综合久久aⅴ免费| 处破女第一次亚洲18分钟| 国产特级淫片免费看| 黄网站色视频免费观看45分钟| 免费永久在线观看黄网站| 美女视频黄频a免费观看| 亚洲&#228;v永久无码精品天堂久久| 亚洲av无码成人精品国产| 亚洲片国产一区一级在线观看| 日韩免费在线中文字幕| 中文字幕精品亚洲无线码二区| 国产精品免费高清在线观看| 77777_亚洲午夜久久多人| 免费电视剧在线观看| 在线观看亚洲网站| 亚洲日韩国产精品乱| 国产一区二区免费视频| 亚洲第一香蕉视频| 日韩免费观看的一级毛片| 国产精品hd免费观看| 亚洲人成在线播放网站岛国| 国产精品免费观看久久| 免费无遮挡无码视频在线观看| 亚洲欧洲无码AV电影在线观看| 国产精品免费精品自在线观看| 亚洲精品无码人妻无码| 亚洲一区二区精品视频| 一级毛片不卡片免费观看| 亚洲熟妇少妇任你躁在线观看| 国产成人亚洲精品91专区手机| 2022久久国产精品免费热麻豆| 天天综合亚洲色在线精品| 久久精品国产亚洲AV网站 | 亚洲成av人在线观看网站| 国产午夜亚洲不卡|