锘??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://www.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://www.tkk7.com/crazycoding/archive/2015/06/19/425793.html</guid><wfw:comment>http://www.tkk7.com/crazycoding/comments/425793.html</wfw:comment><comments>http://www.tkk7.com/crazycoding/archive/2015/06/19/425793.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/crazycoding/comments/commentRss/425793.html</wfw:commentRss><trackback:ping>http://www.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://www.tkk7.com/crazycoding/aggbug/425793.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/crazycoding/" target="_blank">Ying-er</a> 2015-06-19 12:24 <a href="http://www.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://www.tkk7.com/crazycoding/archive/2015/06/11/425614.htmlYing-erYing-erThu, 11 Jun 2015 03:08:00 GMThttp://www.tkk7.com/crazycoding/archive/2015/06/11/425614.htmlhttp://www.tkk7.com/crazycoding/comments/425614.htmlhttp://www.tkk7.com/crazycoding/archive/2015/06/11/425614.html#Feedback0http://www.tkk7.com/crazycoding/comments/commentRss/425614.htmlhttp://www.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://www.tkk7.com/crazycoding/archive/2015/06/11/425613.htmlYing-erYing-erThu, 11 Jun 2015 02:55:00 GMThttp://www.tkk7.com/crazycoding/archive/2015/06/11/425613.htmlhttp://www.tkk7.com/crazycoding/comments/425613.htmlhttp://www.tkk7.com/crazycoding/archive/2015/06/11/425613.html#Feedback0http://www.tkk7.com/crazycoding/comments/commentRss/425613.htmlhttp://www.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: free哆啪啪免费永久| 国产一区二区三区免费| 中文字幕无码播放免费| 久久亚洲国产中v天仙www| 国产日韩精品无码区免费专区国产| 欧美日韩国产免费一区二区三区| 亚洲va在线va天堂va四虎| 国产成人精品免费视频大全| 永久免费无码网站在线观看| 亚洲一区电影在线观看| 0588影视手机免费看片| 亚洲视频免费在线播放| 日本三级2019在线观看免费| 亚洲网站免费观看| 成人超污免费网站在线看| 亚洲乱妇老熟女爽到高潮的片| 午夜视频免费成人| 美女无遮挡免费视频网站 | 女人让男人免费桶爽30分钟| 免费看少妇作爱视频| 亚洲三级视频在线| 色播在线永久免费视频| 鲁啊鲁在线视频免费播放| 亚洲毛片av日韩av无码| 国产高清不卡免费视频| 亚洲婷婷天堂在线综合| 成人午夜大片免费7777| 免费看内射乌克兰女| 亚洲乳大丰满中文字幕| 免费黄色福利视频| 一级视频免费观看| 亚洲日本va午夜中文字幕一区| 成年在线网站免费观看无广告| 看全免费的一级毛片| 亚洲AV乱码久久精品蜜桃| 免费无码又爽又刺激高潮的视频| 无码免费又爽又高潮喷水的视频| 在线免费观看亚洲| 亚洲爽爽一区二区三区| 成人免费毛片内射美女APP| 精品亚洲永久免费精品 |