LSiper
LSiper
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
also I get "Object reference not set to an instance of an object" error when trying to use the usercontrol
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<TextBlock Text="Unit:" FontSize="68" FontWeight="Thin" Margin="8"/>
<TextBlock Grid.Column="1" Text="Measurement:" FontSize="68" FontWeight="Thin" Margin="8"/>

<ListBox x:Name="EntryList" ItemsSource="{Binding Entries}" Grid.Row="1" Grid.ColumnSpan="2">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,8" Width="{Binding ElementName=EntryList, Path=ActualWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" MinWidth="115"/>
<ColumnDefinition Width="45*" MinWidth="195"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Unit}" Margin="0,0,16,0" FontSize="64"/>
<TextBlock Grid.Column="1" Text="{Binding Measurement}" Margin="0,0,16,0" FontSize="64"/>
<Button Grid.Column="2" Content="Delete" HorizontalAlignment="Right" Margin="0,0,16,0" FontSize="56" Click="btnDelete_Click"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<TextBlock Text="Unit:" FontSize="68" FontWeight="Thin" Margin="8"/>
<TextBlock Grid.Column="1" Text="Measurement:" FontSize="68" FontWeight="Thin" Margin="8"/>

<ListBox x:Name="EntryList" ItemsSource="{Binding Entries}" Grid.Row="1" Grid.ColumnSpan="2">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,8" Width="{Binding ElementName=EntryList, Path=ActualWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" MinWidth="115"/>
<ColumnDefinition Width="45*" MinWidth="195"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Unit}" Margin="0,0,16,0" FontSize="64"/>
<TextBlock Grid.Column="1" Text="{Binding Measurement}" Margin="0,0,16,0" FontSize="64"/>
<Button Grid.Column="2" Content="Delete" HorizontalAlignment="Right" Margin="0,0,16,0" FontSize="56" Click="btnDelete_Click"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
I made the listbox inside a usercontrol that will be used in other usercontrols that will be displayed on the main window when you click a button on the navbar
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
how did you manage to make the delete button to delete the specific Entry?
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
okay, thank you so much!
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
will take some time tho
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
If you want I can post here the redesign here once it's done
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
i see
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
since if I also show the results also in the mainwindow I wouldn't have to worry about accessing elements and such.
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
redesign should be better?
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
currently can't decide on if I should do the redesign first and then try to make the program work or if I should just try to get the program to work and then redeisgn
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
not quite familiar with Listbox or datagrids yet
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
Combining all of this with a navigation bar will definitely be better...
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
using itemsSource binding on the second window
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
mainwindow.
<UserControls:ListMeasurements Grid.Row="1" x:Name="FactoryMeasurementsList" Placeholder="Factory" VerticalAlignment="Top"/>
<UserControls:ListMeasurements Grid.Row="1" x:Name="FactoryMeasurementsList" Placeholder="Factory" VerticalAlignment="Top"/>
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
that is a good idea
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
what I want to be saved in the future is let's say you have like 1meter left from one of the planks in the above example that 1 meter leftover would move into the "Existing" usercontrol and if you had way more planks to begin with and some of them weren't used at all in the previously they would stay under "Factory"
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
the side damage and disc settings are only there to setup and get an accurate result.
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
The whole idea of the application is let's you have 2 planks that are different width that would be your "Factory Measurements" and you want to cut the planks into smaller pieces that would be your "New Measurements". When you hit the "optimize" button that doesn't exist currently. The program's purpose is to show/tell the user from which plank to cut what smaller pieces so that they waste less of the planks.
121 replies
CC#
Created by LSiper on 6/10/2024 in #help
WPF how to add data from 2 list entries to a different window that uses a CustomContol
my idea is that everything on the left will eventually have it's save file or something along those lines so that when you open the program you have everything that is left stored there. The add factory measurements can only add measurements or do nothing once that window is closed. I do plan on adding delete buttons to the usercontrol like you showed.
121 replies