silverlight

Calling method of Map control with Caliburn Micro and WP7

对着背影说爱祢 提交于 2019-12-30 14:38:43
问题 I have a page (view) in my Windows Phone 7 application that uses the Silverlight Map control. I need to call the SetView method on the control, but I'd like to stick to the MVVM style of keeping functionality in the view model. I plan to call this method after clicking on an application bar button, so I don't have access to the Map via the EventArgs parameter. What's the best way to do this? 回答1: I haven't worked with the map control myself, but here's a couple of ideas off of the top of my

Silverlight Ftp Upload

梦想的初衷 提交于 2019-12-30 10:25:06
问题 I'm working on trying to ftp a file to the server through a silverlight application. Where the location to upload the file on server file system, exists outside the sandbox area for the web server. In this case the web server root exists at "C:\test\www\" and the location to upload the file will exist at "C:\User\Uploads". In this scenerio i'm not sure if Http POST will work (doesn't that use the web server root). I just need to upload the file selected by the user to a different location

Silverlight DataGrid how to get cell value from a selected item?

断了今生、忘了曾经 提交于 2019-12-30 09:53:11
问题 I am trying to get a cell value from the selected item of a silverlight datagrid. In the attached code I can get to the properties of the cell and change its forecolor, but I can not get the value of the cell. Can someone please let me know what I am doing wrong? Many thanks in advance for your help! private void FindDetails_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid dataGrid = sender as DataGrid; int selectedIndex = dataGrid.SelectedIndex; if (selectedIndex > -1)

Expand/Collapse button in a Silverlight DataGrid

霸气de小男生 提交于 2019-12-30 09:42:36
问题 I am using a RowDetailsTemplate in a Silverlight DataGrid to show row details. Setting RowDetailsVisibilityMode="VisibleWhenSelected" does not give a good user experience (only one row can be expanded at a time, all rows cannot be collapsed). What's the easiest way to add an expand/collapse button on each row so that the rows can be expanded/collapsed independently? 回答1: I've been meaning to blog my solution to this. I set the grid RowDetailsVisibilityMode to Collapsed and use a

Get tag of selected item in WPF ComboBox

梦想与她 提交于 2019-12-30 07:56:40
问题 I have combobox like this: <ComboBox Name="ExpireAfterTimeComboBox" Margin="5" SelectedIndex="0"> <ComboBoxItem Content="15 minutes" Tag="15" /> <ComboBoxItem Content="30 minutes" Tag="30" /> <ComboBoxItem Content="1 hour" Tag="60" /> <ComboBoxItem Content="1 day" Tag="1440" /> </ComboBox> How do I get Tag value in code? writing something like ExpireAfterTimeComboBox.SelectedItem.Tag doesn't work. 回答1: You need to cast it to a type of ComboBoxItem . var selectedTag = ((ComboBoxItem

Custom DataGrid column with a CellTemplate and binding

北慕城南 提交于 2019-12-30 07:04:10
问题 I need to create a reusable DataGrid column with a custom CellTemplate. This CellTemplate should, among other things, contain a TextBlock control to which I need to bind values to display in the DataGrid. All examples I've seen so far specified the CellTemplate for a column directly when using it in a DataGrid's Columns property and also specified a Binding directly to the TextBlock, e.g.: <data:DataGrid> <data:DataGrid.Columns> <data:DataGridTemplateColumn Header="Name"> <data

wp7 horizontal swipe selection

只谈情不闲聊 提交于 2019-12-30 06:53:30
问题 I'm looking for a control that allows me to swipe through a list of items. Swiping horizontally would move between the next and previous items. The control would also ensure the selected item is moved to the center when not being manipulated. This control will only take up half of the page and I'd like the options to the left and right to be visible and wrap around. Like so <--> *][**][* So my question is, does a control like this already exists and if so what is it called? 回答1: This is super

Are the advantages of Model-View-ViewModel (MVVM) pattern worth the overhead?

别等时光非礼了梦想. 提交于 2019-12-30 06:11:43
问题 The question is stated in the subject: are the advantages of Model-View-ViewModel (MVVM) pattern worth the overhead? In many cases, implementing the view model involves quite significant overhead of duplicating the Model properties and sometimes synchronization between Model and ViewModel data members. For example, currently in Silverlight 4 & WCF RIA, View Models are not generated (if the developer follows the MVVM pattern, it is up to him to create the view models, often duplicating the

Find position of Button/UIElement on screen relative to grid Windows Phone

孤者浪人 提交于 2019-12-30 06:08:41
问题 I can't find a way to get the position in (x,y) co-ordinates of an on-screen control like a button relative to the grid that it is inside. Is there a way to do this that I am overlooking? 回答1: var transform = button.TransformToVisual(grid); Point absolutePosition = transform.Transform(new Point(0, 0)); From How to get the position of an element in a StackPanel?. 来源: https://stackoverflow.com/questions/8206294/find-position-of-button-uielement-on-screen-relative-to-grid-windows-phone

tag does not exist in XML namespace

回眸只為那壹抹淺笑 提交于 2019-12-30 05:40:06
问题 This error seems to be posted all over the place but each one seems to have its own solution, none of which solved my problem. I am getting an error for a Resource Dictionary I am making (and later merging) that the tag 'ModelBindings' does not exist in XML namespace 'clr-namespace:Company.Project.Module.Folder;assembly=Company.Project.Module' The assembly I am referencing is custom and contained within the solution. Not only that but we have looked at the dll put into the bin for the project