silverlight

C# windows to C# phone windows

允我心安 提交于 2020-01-03 06:38:27
问题 This is more a task to ask than help but... after 1 day of tries I can't get it work. This is my code private string _InetReadEx(string sUrl) { HttpWebRequest webReq = (HttpWebRequest)HttpWebRequest.Create(sUrl); try { webReq.CookieContainer = new CookieContainer(); webReq.Method = "GET"; using (WebResponse response = webReq.GetResponse()) { using (Stream stream = response.GetResponseStream()) { StreamReader reader = new StreamReader(stream); aRet = reader.ReadToEnd(); return aRet; } } }

Silverlight DataStateBehavior, initial value not used

安稳与你 提交于 2020-01-03 06:21:48
问题 I am trying to use the Silverlight DataStateBehavior, it works fine in most cases where I click a button which sets say a 'Selected' Property in the view model to either false or true. The DataStateBehavior then tells the VisualStateManager to go to the relevant state. Like this: <Button...> <i:Interaction.Behaviors> <id:DataStateBehavior Binding="{Binding Selected}" Value="True" TrueState="SelectedVisualState" FalseState="DeselectedVisualState"/> </i:Interaction.Behaviors> </Button> The

Silverlight Fast Moving Bitmap Does Not Update Smoothly

半腔热情 提交于 2020-01-03 06:07:14
问题 When I move a bitmap-filled path in Silverlight by updating its RenderTransform, the image updates with a stutter/jitter about every half-second. The Path uses a BitmapCache, and Hardware Acceleration is turned on. The hardware acceleration is verified using the EnableCacheVisualization option, and by observing that the frame rate is high ~ 60 fps. You can see what I am talking about here. It is a working silverlight app showing the stuttering behavior. (You might imagine what game I am

Bind DataGrid Column to ViewModel Property

感情迁移 提交于 2020-01-03 05:25:09
问题 If I have the following DataGrid, how would I go about binding the Visibility of the TemplateColumn to a property on my ViewModel? The code I have here is based on a recommendation from this SO Question but no luck. <sdk:DataGrid Visibility="{Binding GridVisible}" DataContext="{Binding}" Grid.Row="1" ItemsSource="{Binding Path=BookSource}" x:Name="bookGrid" AutoGenerateColumns="False" IsReadOnly="True"> <sdk:DataGrid.Columns> <sdk:DataGridTemplateColumn Visibility="{Binding Path=DataContext

How to force execution to stop till asynchronous function is fully executed?

空扰寡人 提交于 2020-01-03 05:22:10
问题 I'm creating a silverlight application for CRM as follow: 1- A usercontrol which is a form is filled with data retrieved from the CRM using async/await 2- A Print button that creates an instance of that usercontrol and prints it I have a problem in the sequence of execution that causes the Print button to print the usercontrol with no data, meaning, it's executed before the async method finishes. My code is as follows: User control: Public partial class ManagerContact : UserControl //

Need a simple Example of cascading combo boxes using MVVM

别等时光非礼了梦想. 提交于 2020-01-03 05:11:11
问题 Need a simple Example of cascading combo boxes using MVVM Wpf / Silverlight 回答1: If I understand your question you want to have the next combobox to fill with data based on the previous value. I have a generic ViewModel that you can have to capture the list of items and the selected item class ItemListViewModel<T> : INotifyPropertyChanged where T : class { private T _item; private ObservableCollection<T> _items; public ItemListViewModel() { _items = new ObservableCollection<T>(); _item = null

Animation target not specified issue - Silverlight storyboards

你。 提交于 2020-01-03 04:56:04
问题 Having some real head scratching going on here as I can't seem to think why I am getting the Animation target not specified error. I create a static class for dishing out storyboards of lots of little fires "burning". I then create as many of those fires as the user wants and assign a new storyboard to it, all in Csharp. I then begin then storyboard, but as I say, I keep getting this error and I can't seem why. Here is the storyboard creating class, and when I try to call it. public static

Programmatically set content in Silverlight DataGrid details

a 夏天 提交于 2020-01-03 03:45:13
问题 I need to dynamically set the contents within the template of a DataGrid based on information in an external settings file. That settings file specifies which data fields should display in the DataGrid. The administrator of the application can edit the settings to change the fields to display. I cannot hard-code the fields to display. I can easily add the columns (DataGridTextColumn's) to the DataGrid at runtime. I set a binding to a field in the item source based on the settings, and that

Animation in codebehind for loop, using RenderTransform

久未见 提交于 2020-01-03 03:13:08
问题 Is it possible to animate the "old school" way, in codebehind, instead of xaml? I just want an arrow that points to something with a 'bounce effect' which I could easily do in my own for loop. But I do not know how to refresh or do a timer delay, inside the loop. I already placed the image into position in codebehind. All I want to do is this simple animation... public void validationArrow() { var validationArrow = new Image(); validationArrow.Source = new BitmapImage(new Uri("/SlProject

VB silverlight for windows phone “Handles clause requires a WithEvents variable defined in the containing type or one of its base types”

╄→尐↘猪︶ㄣ 提交于 2020-01-03 02:54:11
问题 When I am selecting a button from the .xaml file and then tap event from the right (in order to set the tap event) it auto generates this sub: Private Sub btn(ByRef sender As Object, e As System.Windows.RoutedEventArgs) Handles btn.Tap End Sub But it also has this error: Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. Any suggestions? Thank you! 回答1: Public WithEvents btn As Button just above the sub in order to send away the bug