silverlight

Why are my “replacement parameters” getting transformed into empty strings?

我与影子孤独终老i 提交于 2019-12-25 07:22:35
问题 This is the code when "at rest": var report_parms = { GUID: "@Model.GUID", SerialNumber: "@Model.SerialNumber", ReportName: "@Model.ReportName" }; This is what it looks like at run-time, when stepping through the jQuery: var report_parms = { GUID: "", SerialNumber: "", ReportName: "" }; ...and this is the exception I get because those strings are empty: System.NullReferenceException was unhandled by user code Message=Object reference not set to an instance of an object. StackTrace: at

The DataContext object and assigning its properties

依然范特西╮ 提交于 2019-12-25 06:46:55
问题 The short story is that I would like to be able to assign an IEnumerable to my Context.Customers property (this being table imported from SQL of type System.Data.Linq.Table; Customer being an entity type). Now the first thing you might wonder is 'why would you do this?' Yes, ordinarily there are better ways to do this, but I am not operating under ordinary circumstances. A limitation on my project means I do not have access to the 'web' part of the project. As a result, I'm going about this

.NET Class Interface, Inheritance and Library: error does not implement interface member

好久不见. 提交于 2019-12-25 06:25:50
问题 I want to do this (I'm on silverlight but nothing specific so want to do this also on winform and wpf) namespace MyComponents { public class IMyManager : ILibManager { void SetModel(ILibModel model); } } but get this error Error 2 'MyComponents.IMymanager' does not implement interface member 'lib.manager.ILibManager.SetModel(lib.model.ILibModel)'. 'MyComponents.IMymanager.SetModel(lib.model.ILibModel)' cannot implement an interface member because it is not public. C:...\MyComponents

How can I implement my own async callback in C# wp7 silverlight?

主宰稳场 提交于 2019-12-25 06:21:06
问题 I am trying to port an engine into C# WP7 silverlight, along with its unit tests. Because it uses http requests, it needs to be asynchronous as dictated by the framework. The Android version of the engine I am porting uses synchronous blocking sockets on a worker thread. It invokes a callback whenever the entire operation is complete (not just the http request). Question - how can I wrap the callback mechanism so that it does an asynch callback that can be used in an [Asynchronous] unit test?

Accessing ComboBox inside a Datatemplate of a listbox from c# code behind in metro application?

 ̄綄美尐妖づ 提交于 2019-12-25 06:09:41
问题 i have a combo box present inside a list-box , listbox has a datatemplate in which this combobox and other elements resides . <ListBox x:Name="lstbxbProducts" HorizontalAlignment="Left" Height="547" Margin="0,221,0,0" VerticalAlignment="Top" Width="1044" RenderTransformOrigin="0.600000023841858,0.5"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <StackPanel Width="80" Orientation="Horizontal"> <TextBlock Text="{Binding prdnum}" VerticalAlignment="Center"

Saving UserControl as a JPG - result is “squished”

北城余情 提交于 2019-12-25 05:13:15
问题 I'm having a strange issue with saving a UserControl as a JPG. Basically what I want to do is create a Live Tile that I can update using a Background Agent (as well as from within the app itself.) I've followed the steps in this blog post which work great for when I create the tile; I have a custom UserControl with some TextBlocks on it which gets saved as a JPG into IsolatedStorage, exactly as the post says. Creating the tile is no problem - the UserControl is rendered nicely as it should be

How to make the binding happen from the ViewModel

落花浮王杯 提交于 2019-12-25 05:08:18
问题 I'm trying to capture the Enter key being pressed on a text box, so that I can kick off an update to the server. It's not working, and so I've reduced the problem to it's simplist elemetns. In this example, it seems that the binding is not happening per keystroke, but at sometime later. I need to the binding to be completed by the time the enter key is pressed. Consider the following XAML and function from the VM. Here's the XAML of the textbox <TextBox Text="{Binding TextValue, Mode=TwoWay}"

Silverlight make a column bound to a array item editable

落花浮王杯 提交于 2019-12-25 05:05:24
问题 I have a DataGrid in my Silverlight application, which is bound to an array of objects. Since the columns will be variable, I bound each of them to an array item: My object: public class TravelTimeItem { public string From { get; set; } public int[] Times { get; set; } } I build my grid with that: grdTravelTime.Columns.Clear(); grdTravelTime.Columns.Add(new DataGridTextColumn() { Binding = new Binding("From") }); for (int i=0; i < amountOfColumns; i++) grdTravelTime.Columns.Add(new

Silverlight make a column bound to a array item editable

筅森魡賤 提交于 2019-12-25 05:05:19
问题 I have a DataGrid in my Silverlight application, which is bound to an array of objects. Since the columns will be variable, I bound each of them to an array item: My object: public class TravelTimeItem { public string From { get; set; } public int[] Times { get; set; } } I build my grid with that: grdTravelTime.Columns.Clear(); grdTravelTime.Columns.Add(new DataGridTextColumn() { Binding = new Binding("From") }); for (int i=0; i < amountOfColumns; i++) grdTravelTime.Columns.Add(new

Silverlight Datagrid: Highlight an entire Column?

天大地大妈咪最大 提交于 2019-12-25 04:49:06
问题 I have a DataGrid in my Silverlight application, and would like to "highlight" an entire column when any cell in that column is selected. E.g., given this grid (where " [ ] " represents a cell): [ ][ ][ ] [ ][ ][ ] [ ][ ][ ] If I select a cell, like this [ ][ selected ][ ] [ ][ ][ ] [ ][ ][ ] I would like all the cells in that column, including the selected cell, to be "highlighted" (can be as simple as just changing the background color): [ ][ selected ][ ] [ ][ highlighted ][ ] [ ][