Find Jobs
Hire Freelancers

C# - WPF DataGrid with dynamic button on each row - Help for DataTemplateSelector

$10-30 USD

Terminado
Publicado hace más de 3 años

$10-30 USD

Pagado a la entrega
I wrote a small application, which lists some files containing XML-snippets from a folder into a DataGrid. Now I want to add a button with the label "Install" to the first column, which gives the user the possibility to install the snippet to another file. If this snippet is already included into the file, the button should change to "Uninstall". Therefore I added the following to my XAML: ````xaml ... <[login to view URL]> <local:ButtonTemplateSelector x:Key="buttonTemplateSelector"> <local:[login to view URL]> <DataTemplate> <Button x:Name="btn_installSnippet" Click="btn_installSnippet_Click">Install</Button> </DataTemplate> </local:[login to view URL]> <local:[login to view URL]> <DataTemplate> <Button x:Name="btn_uninstallSnippet" Click="btn_uninstallSnippet_Click">Uninstall</Button> </DataTemplate> </local:[login to view URL]> </local:ButtonTemplateSelector> </[login to view URL]> ... <DataGrid x:Name="dataGrid_newViews" ItemsSource="{Binding}" HorizontalAlignment="Left" Height="148" Margin="40,152,0,0" VerticalAlignment="Top" Width="685" AutoGenerateColumns="True" SelectedCellsChanged="Datagrid_SelectedCellsChanged" CanUserAddRows="false" Grid.ColumnSpan="2"> <[login to view URL]> <DataGridTemplateColumn Header="Button" CellTemplateSelector="{StaticResource buttonTemplateSelector}" /> </[login to view URL]> </DataGrid> ```` Now I have problems with the code part, where the correct DataTemplate should be selected depending on a condition. ````c# public class ButtonTemplateSelector : DataTemplateSelector { public DataTemplate InstallButtonTemplate { get; set; } public DataTemplate UninstallButtonTemplate { get; set; } public override [login to view URL] SelectTemplate(object item, [login to view URL] container) { if(!CheckIfXmlAlreadyInstalled(<data>) { return InstallButtonTemplate; } else { return UninstallButtonTemplate; } } ```` I do not know how to pass the correct values to my condition part. Who can help me?
ID del proyecto: 27454627

Información sobre el proyecto

3 propuestas
Proyecto remoto
Activo hace 4 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi! How are you? I am interested in your project. I have been developed many C# WPF projects for 10 years. I read your description in detail and can help you well. Please contact me. Best Regard
$30 USD en 1 día
5,0 (37 comentarios)
5,6
5,6
3 freelancers están ofertando un promedio de $27 USD por este trabajo
Avatar del usuario
Hi I'm interested of your post and exciting to do the over your project. please let me know your availability for further discussion
$30 USD en 2 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hi, I am interested and I was actually looking for this sort of project too. I want to help you develop this app and fix your error. I have worked with WPF and XML files so I think I am the right person for the job which I am hopeful you will accept too once we get into talking. I really look forward to hearing from you. Thanks
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de GERMANY
Hamburg, Germany
5,0
10
Forma de pago verificada
Miembro desde oct 1, 2013

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.