binding

Creating Custom Binding programmatically

假装没事ソ 提交于 2020-01-15 10:06:00
问题 We need compression in our WCF Web Service and have already found a good solution: http://www.codeproject.com/Articles/53718/Extending-WCF-Part-II There's only one problem. Configuration files are no option. How those Custom Bindings can be created in code? <customBinding> <binding name="ZipBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"> <customMessageEncoding innerMessageEncoding="mtomMessageEncoding" messageEncoderType=

Combining WPF DataTriggers and Storyboard in code

北城以北 提交于 2020-01-15 07:18:06
问题 (This is an attempt to solve my earlier problem in a different way.) I've created a user control which uses a RadialGradientBrush that I would like to be able to animate by setting a property on my view model. The gradient brush also has some properties that are bound to the view model. The XAML for the user control is (some properties snipped for brevity): <UserControl x:Class="WpfApplication1.AnimatedLineArrow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:

Combining WPF DataTriggers and Storyboard in code

。_饼干妹妹 提交于 2020-01-15 07:17:06
问题 (This is an attempt to solve my earlier problem in a different way.) I've created a user control which uses a RadialGradientBrush that I would like to be able to animate by setting a property on my view model. The gradient brush also has some properties that are bound to the view model. The XAML for the user control is (some properties snipped for brevity): <UserControl x:Class="WpfApplication1.AnimatedLineArrow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:

unable to set focus to datepicker using attached property in wpf

≡放荡痞女 提交于 2020-01-15 04:19:13
问题 I have a custom datepicker with me and i am trying to set focus to this using attached property. I have the toolkit version 3.5.50211.1 which was released on Feb 2010. The focus is working fine when i do DatePicker.Focus(); in my code. My custom datepicker code is as follows: -- My DatePicker using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Windows.Controls; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System

WPF DataGridTemplateColumn Header binding not working

依然范特西╮ 提交于 2020-01-15 03:21:06
问题 I am using the DataGrid with some manually created DataGridTemplateColumns. Here is a code snippet of that in work: <DataGrid ItemsSource="{Binding Projects, Mode=OneWay}" SelectedItem="{Binding SelectedProject}" SelectionMode="Single" CanUserSortColumns="True" RowBackground="Transparent"> <DataGrid.Columns> <DataGridTemplateColumn Header="Art" Width="60" /> <DataGrid.Columns> <DataGrid> Everything works just fine, data is loaded and my column is displayed as expected. However, when i try to

Disconnect incoming call programmatically in android Nougat Api 24

*爱你&永不变心* 提交于 2020-01-15 01:20:40
问题 I'm going to use endCall method of ITelephony.aidl to disconnect all incoming calls programmatically. This is my BroadcastReceiver: public class CallBlocker extends BroadcastReceiver { String number; @Override public void onReceive(Context context, Intent intent) { if (intent.getAction() != null && intent.getAction().equals("android.intent.action.PHONE_STATE")) { disconnectIncomingCall(context); } } private void disconnectIncomingCall(Context context) { ITelephony telephonyService;

Binding to SelectedItem with a referenced ItemsSource

坚强是说给别人听的谎言 提交于 2020-01-14 19:29:06
问题 Intro I have got a pool of different DataSources. I've got Masks. Masks have got Indexlines. Each Indexline has a single DataSource from the pool associated: Classes public class DataSource { public string Name { get; set; } public override string ToString() { return Name; } } public class Mask { public string Name { get; set; } public ObservableCollection<Indexline> Indexlines { get; set; } public override string ToString() { return Name; } } public class Indexline { public DataSource

Updating one element of a bound Observable collection

柔情痞子 提交于 2020-01-14 14:12:09
问题 I have an observable collection with a custom class called songInfo inside. It is bound to a ListView . Here is the code for the binding: C# : var songData = new ObservableCollection<songInfo>(); public ObservableCollection<songInfo> _songData { get { return songData; } } public class songInfo { public string Title { get; set; } public string Artist { get; set; } public string Album { get; set; } public string Location { get; set; } public string Ext { get; set; } public bool isSongPlaying {

Updating one element of a bound Observable collection

大兔子大兔子 提交于 2020-01-14 14:11:55
问题 I have an observable collection with a custom class called songInfo inside. It is bound to a ListView . Here is the code for the binding: C# : var songData = new ObservableCollection<songInfo>(); public ObservableCollection<songInfo> _songData { get { return songData; } } public class songInfo { public string Title { get; set; } public string Artist { get; set; } public string Album { get; set; } public string Location { get; set; } public string Ext { get; set; } public bool isSongPlaying {

Injecting a dependency into a custom ModelBinder

做~自己de王妃 提交于 2020-01-14 13:44:08
问题 I have an ASP.net MVC project in the works at the moment, and I'm wondering if the following could be possible: I have a custom ModelBinder class that has a reference to a service (essentially a fetcher) as a dependency. I want the dependency to be injected using an IoC container (currently Ninject) but there seems to be nowhere in the method chain that I can plug in something that says load the model binder from my IoC container. My first thought is to have a generic object binder that then