Click here to Skip to main content
14,137,520 members

.NET Framework

 
PinnedHOW TO ANSWER A QUESTION Pin
Chris Maunder16-Jul-09 3:09
adminChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question Pin
Chris Maunder16-Jul-09 3:05
adminChris Maunder16-Jul-09 3:05 
QuestionMessage Closed Pin
21-Apr-19 6:53
memberMember 1432178121-Apr-19 6:53 
AnswerRe: 阿萨德群无若群无若无群若 Pin
Richard Andrew x6421-Apr-19 7:32
professionalRichard Andrew x6421-Apr-19 7:32 
AnswerRe: 阿萨德群无若群无若无群若 Pin
Eddy Vluggen21-Apr-19 14:52
mveEddy Vluggen21-Apr-19 14:52 
QuestionPassing Value from XAML to ViewModel Pin
Jassim Rahma20-Apr-19 13:45
memberJassim Rahma20-Apr-19 13:45 
Hi,

I am using Syncfusion in my project and I am showing this ListView:
<SyncfusionListView:SfListView x:Name="ListViewNewItemLocations" SelectionBackgroundColor="Transparent" IsVisible="False" IsScrollBarVisible="false" AutoFitMode="Height" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" ItemAppearing="ListViewNewItemLocations_ItemAppearing" ItemTapped="ListViewNewItemLocations_ItemTapped">
    <SyncfusionListView:SfListView.ItemTemplate>
        <DataTemplate>
            <Frame BorderColor="Black" CornerRadius="25" HasShadow="False">
                <StackLayout>
                    <Label Margin="0,0,0,0" Text="{Binding country_name}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start"  FontSize="15" LineBreakMode="WordWrap" />
                    <Label Margin="0,0,0,0" Text="{Binding location_address}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start"  FontSize="15" LineBreakMode="WordWrap" />
                    <Label Margin="0,0,0,0" Text="{Binding telephone}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start"  FontSize="15" LineBreakMode="WordWrap" />

<pre>
                <Grid HorizontalOptions="FillAndExpand">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationEdit2" IsVisible="False" BackgroundColor="Brown" Text="Edit" Grid.Column="0" CornerRadius="25" />
                    <Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationEdit" Clicked="ButtonNewItemLocationEdit_Clicked_1" ClassId="abcd" BackgroundColor="Brown" Text="Edit" Grid.Column="0" CornerRadius="25" Command="{Binding Path=BindingContext.TapCommand, Source={x:Reference ListViewNewItemLocations}}" CommandParameter="{Binding LocationModel.ItemLocationID}" />
                    <Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationDelete" IsVisible="{Binding IsDeleteVisible}" BackgroundColor="Red" Text="Delete" Grid.Column="1" CornerRadius="25" />
                </Grid>
            </StackLayout>
        </Frame>
    </DataTemplate>
</SyncfusionListView:SfListView.ItemTemplate>




and I have I have a ViewModel like this:
using System;
using System.Collections.Generic;
using System.Text;
using Syncfusion.ListView.XForms;
using Syncfusion.XForms.PopupLayout;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace Zeera
{
    public class ViewModelItemLocation : INotifyPropertyChanged
    {
        public Command<object> TapCommand { get; set; }
        SfPopupLayout popupLayout;

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string name)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(name));
        }

        public ViewModelItemLocation()
        {
            TapCommand = new Command<object>(EditButtonTapped);
        }

        private void EditButtonTapped(object obj)
        {
            popupLayout = new SfPopupLayout();
            popupLayout.PopupView.HeightRequest = 500;
            popupLayout.PopupView.WidthRequest = 300;
            // popupLayout.BindingContext = ModelBinding;

            popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
            {

                var mainStack = new StackLayout();
                mainStack.BackgroundColor = Color.AliceBlue;

                var image = new Image();
                image.SetBinding(Image.SourceProperty, new Binding("ContactImage"));

                var grid = new Grid();
                var NameLabel = new Label()
                {
                    Text = "Customer Name  "
                };

                NameLabel.HorizontalOptions = LayoutOptions.Start;

                var label1 = new Entry()
                {

                };

                label1.SetBinding(Entry.TextProperty, new Binding("ContactName"));
                label1.HorizontalOptions = LayoutOptions.Start;

                var NumberLabel = new Label()
                {
                    Text = "HERE LOCATIO ID"
                };
                NumberLabel.HorizontalOptions = LayoutOptions.Start;

                var label2 = new Entry()
                {

                };

                label2.SetBinding(Entry.TextProperty, new Binding("ContactNumber"));
                label2.HorizontalOptions = LayoutOptions.Start;

                grid.Children.Add(NameLabel, 0, 0);
                grid.Children.Add(label1, 1, 0);
                grid.Children.Add(NumberLabel, 0, 1);
                grid.Children.Add(label2, 1, 1);

                mainStack.Children.Add(image);
                mainStack.Children.Add(grid);

                return mainStack;
            });

            popupLayout.PopupView.ShowHeader = false;
            popupLayout.PopupView.ShowFooter = false;
            popupLayout.HeightRequest = 500;
            popupLayout.WidthRequest = 500;
            popupLayout.Show();
        }
    }
}

I have a questions here: How can I pass item_location_id (binded to the SfListView) to the ViewModelItemLocation and then show it in the NumberLabel (created in the ViewModelItemLocation code behind)

Thanks,
Jassim

www.softnames.com

AnswerRe: Passing Value from XAML to ViewModel Pin
Gerry Schmitz21-Apr-19 5:56
mveGerry Schmitz21-Apr-19 5:56 
AnswerMessage Closed Pin
8-May-19 20:03
memberrobermartin8-May-19 20:03 
QuestionWriting unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
simpledeveloper19-Apr-19 14:32
membersimpledeveloper19-Apr-19 14:32 
AnswerRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
Gerry Schmitz21-Apr-19 6:08
mveGerry Schmitz21-Apr-19 6:08 
GeneralRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
simpledeveloper21-Apr-19 16:58
membersimpledeveloper21-Apr-19 16:58 
GeneralRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
Gerry Schmitz22-Apr-19 4:36
mveGerry Schmitz22-Apr-19 4:36 
GeneralRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
simpledeveloper22-Apr-19 7:07
membersimpledeveloper22-Apr-19 7:07 
GeneralRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
Gerry Schmitz22-Apr-19 8:28
mveGerry Schmitz22-Apr-19 8:28 
GeneralRe: Writing unit tests for two methods of the same Service are being called in one method: FluentAssertions Pin
simpledeveloper22-Apr-19 8:55
membersimpledeveloper22-Apr-19 8:55 
Question“Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
VictorSotnikov9-Apr-19 5:52
memberVictorSotnikov9-Apr-19 5:52 
AnswerRe: “Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
Gerry Schmitz9-Apr-19 6:15
mveGerry Schmitz9-Apr-19 6:15 
GeneralRe: “Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
VictorSotnikov9-Apr-19 6:28
memberVictorSotnikov9-Apr-19 6:28 
GeneralRe: “Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
Gerry Schmitz10-Apr-19 5:39
mveGerry Schmitz10-Apr-19 5:39 
GeneralRe: “Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
David A. Gray3-May-19 7:33
groupDavid A. Gray3-May-19 7:33 
GeneralRe: “Collection was modified; enumeration operation might not execute” inside System.Data.TypedTableBase<> Pin
Gerry Schmitz3-May-19 8:48
mveGerry Schmitz3-May-19 8:48 
Questionregarding the cryptarithmatic code in your website Pin
Member 141248901-Apr-19 4:32
memberMember 141248901-Apr-19 4:32 
AnswerRe: regarding the cryptarithmatic code in your website Pin
Richard MacCutchan1-Apr-19 4:42
protectorRichard MacCutchan1-Apr-19 4:42 
QuestionIs there any way to initialize or set values for this declaration as inline statement private IList<MockData<OnlineRegistration, OnlineRegistration, OnlineRegistration>> _registerMocks; Pin
simpledeveloper28-Mar-19 7:18
membersimpledeveloper28-Mar-19 7:18 
AnswerRe: Is there any way to initialize or set values for this declaration as inline statement private IList<MockData<OnlineRegistration, OnlineRegistration, OnlineRegistration>> _registerMocks; Pin
Eddy Vluggen29-Mar-19 2:33
mveEddy Vluggen29-Mar-19 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.190518.1 | Last Updated 9 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid