data-binding

Binding TreeView to DataSet

天涯浪子 提交于 2021-02-07 10:22:25
问题 I have a dataset I created from a Oracle Query. I get a datatable from a function and add it to dataset. now I try to bind to treeview to the ds. My code Behind: private void init_TreeView() { //TreeViewItem parent = PM_TreeView.Items.Add("Requirements"); DataTable dt = DataBases.RunQuery(); dt.TableName = "REQ"; DataSet ds = new DataSet(); ds.Tables.Add(dt); //ds.Relations.Add("rsParentChild", ds.Tables["REQ"].Columns["RQ_REQ_ID"], ds.Tables["REQ"].Columns["RQ_FATHER_ID"]); var dataSet = ds;

Prevent QML Property Bindings when QML object isn't visible?

谁说胖子不能爱 提交于 2021-02-07 06:53:15
问题 I'm working on a QML application that has a lot of property bindings: hundreds of objects are tracked and displayed in different forms like Qt3D/QCanvas. When I'm on a separate page of the application those property bindings for x/y locations and relative sizes are still happening. How can I stop them? I know I could bind the properties based on whether they're visual or not but that is a lot of unnecessary code: x: visible ? tracking.location(index).x : 0 I would have to wrap a ton of

Blazor: binding to a MultiSelectList (ideally with a checkbox)

此生再无相见时 提交于 2021-02-07 06:48:43
问题 Experimenting with Blazor (Server, if that makes any difference), and I'm having difficulty getting binding to a MultiSelectList to work.... Bit of background: I'm dealing with EF Core and have a Many-to-Many relationship, let's say between people and cars. I'm currently loading a page that shows the existing details, and allowing the user to update this page. So in my Service, I load my Person entity from the DB, and this includes the details of all the cars they currently own. I also load

Good way to refresh databinding on all properties of a ViewModel when Model changes

只谈情不闲聊 提交于 2021-02-05 13:03:45
问题 Short Version If I update the Model object that my ViewModel wraps, what's a good way to fire property-change notifications for all the model's properties that my ViewModel exposes? Detailed Version I'm developing a WPF client following the MVVM pattern, and am attempting to handle incoming updates, from a service, to data being displayed in my Views. When the client receives an update, the update appears in the form of a DTO which I use as a Model. If this model is an update to an existing

Why doesn't a ListBox bound to an IEnumerable update?

白昼怎懂夜的黑 提交于 2021-02-05 11:23:26
问题 I have the following XAML: <Window x:Class="ListBoxTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ListBoxTest" Title="MainWindow" Height="350" Width="525"> <Window.DataContext> <local:Model /> </Window.DataContext> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <ListBox ItemsSource="{Binding Items}" Grid.Row="0"/>

Why doesn't a ListBox bound to an IEnumerable update?

戏子无情 提交于 2021-02-05 11:23:13
问题 I have the following XAML: <Window x:Class="ListBoxTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ListBoxTest" Title="MainWindow" Height="350" Width="525"> <Window.DataContext> <local:Model /> </Window.DataContext> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <ListBox ItemsSource="{Binding Items}" Grid.Row="0"/>

How to write this java code to kotlin in Binding Adapter

泪湿孤枕 提交于 2021-02-05 09:28:35
问题 I have some lines of code written in onBindViewHolder in lang (java) .. I'm trying to write the exact code in kotlin in Binding Adapter , but i'm not able to write that EarthQuakeAdapter( JAVA) .. I tried but i was not able to write the same code to get magnitudeCircle , PrimaryLocation and LocationOffSet from onBindViewHolder(JAVA lang) method to Binding Adapter in kotlin which i posted below public class EarthquakeAdapter extends RecyclerView.Adapter<EarthquakeAdapter.MyViewHolder> {

How to write this java code to kotlin in Binding Adapter

吃可爱长大的小学妹 提交于 2021-02-05 09:27:48
问题 I have some lines of code written in onBindViewHolder in lang (java) .. I'm trying to write the exact code in kotlin in Binding Adapter , but i'm not able to write that EarthQuakeAdapter( JAVA) .. I tried but i was not able to write the same code to get magnitudeCircle , PrimaryLocation and LocationOffSet from onBindViewHolder(JAVA lang) method to Binding Adapter in kotlin which i posted below public class EarthquakeAdapter extends RecyclerView.Adapter<EarthquakeAdapter.MyViewHolder> {

WPF: Binding to MainWindow Property

隐身守侯 提交于 2021-02-05 08:46:26
问题 I am having an issue with binding to a parent MainWindow property, MainContentVisibility. I have the following code: MainWindow.xaml <Window x:Class="CallTracker.WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:v="clr-namespace:MyProgram.WPF.Views" DataContext="{Binding MainPageViewModel, Source={StaticResource Locator}}"> <StackPanel> <v:CompanyInfoUserControl Width="800" Visibility="{Binding MainContentVisibility, RelativeSource={RelativeSource Mode

Binding dynamically created control in code behind

一世执手 提交于 2021-02-05 08:20:08
问题 I have dynamically created popups that get created at run-time in the C# code behind that is filled with content from the xaml and having difficulty on how to bind them in the code behind. Right now when it is created, it loops through the items in the xaml and creates an associated checkbox for each one: ListView listView = new ListView(); //Create ListViewItem for each answer foreach (Answer ans in Questions.DataUsedQuestion.AnswerOptions) { ListViewItem item = new ListViewItem();