Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all 18858 articles
Browse latest View live

Problem with dialog box running twice

$
0
0

Hello all.

I am having trouble to figure out a problem with a dialog box.

I show the dlg from the main menu like this.

 private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            DialogRender dlg = new DialogRender();
            dlg.Owner = this;
            dlg.ShowDialog();

         //from here on the code is not implemented yet

        }

The code in the DialogRender.xaml file is :

<Button x:Name="okButton" DockPanel.Dock="Left"  Click="okButton_Click" Width="40" Height="25">OK</Button>
<Button x:Name="cancelButton"  DockPanel.Dock="Left" IsCancel="True" Width="40" Height="25" Click="cancelButton_Click">Cancel</Button>

and the code for the buttons are :

 private void okButton_Click(object sender, RoutedEventArgs e)

        {
            this.DialogResult = true;
         }
 private void cancelButton_Click(object sender, RoutedEventArgs e)
        {

   this.DialogResult = false;
        }

The problem is that when the Ok or Cancel button is pressed it recreates the dialog box entering a second time in the 

 DialogRender dlg = new DialogRender();
            dlg.Owner = this;
            dlg.ShowDialog();

It means that I always have to press OK or cancel two times to close the dialog box.

Any ideas.

TIA.

Jair Santos


Jair Santos


Using IEditableCollectionView on an empty collection

$
0
0

Hi,

I have an ObservableCollection that we manage items through an IEditableCollectionView. However when the collection is empty, and we try to add an item it throws an error as "Index was out of range. Must be non-negative and less than the size of the collection.". From reading a few articles it appears that without any items in the ObservableCollection, it can not determine the type of object to create.

As such we've implemented a temp workaround by checking if any items are in the ObservableCollection before trying to add the item using IEditableCollectionView.

' link to the list
        Dim sp As SpecialCollection = DirectCast(Me.FindResource("SpecialCollectionResource"), SpecialCollection)
        Dim spv As IEditableCollectionView = DirectCast(CollectionViewSource.GetDefaultView(Me.Example_List.Items), IEditableCollectionView)
        spv.NewItemPlaceholderPosition = NewItemPlaceholderPosition.None' add a new item to the list
        If sp.Count > 0 Then
            ' other items are in the collection, we can use the collection view for item manipulation
            Dim item As Item = spv.AddNew()
            With item
                .SetName = "New"
                .ID = sp.Count
            End With
            spv.CommitNew()
        Else
            ' first item in collection, we have to update the source collection directly
            Dim item As Item = New Item
            With item
                .SetName = "New"
                .ID = sp.Count
            End With
            sp.Add(item)
            ' need to rebuild the dependant view(s)
            sp.FireCollectionChanged()
        End If


In comments of this thread they mention changing the definition of the ObservableCollection from

PersonsList : ObservableCollection<Person> { }

to

PersonsList<T> : ObservableCollection<T> where T : Person {}

My own ObservableCollection is defined like this:

Public Class SpecialCollection
    Inherits ObservableCollection(Of Item)

How could I update this definition to allow IEditableCollectionView to work natively with an empty collection?

Other possible useful information, Item is just a normal class, the collection and collectionviewsource is defined in the xaml layer:

<local:SpecialCollection x:Key="SpecialCollectionResource" /><CollectionViewSource x:Key="SpecialCollectionViewResource" 
                              Source="{StaticResource ResourceKey=SpecialCollectionResource}"><CollectionViewSource.SortDescriptions><cm:SortDescription PropertyName="SetName" /><cm:SortDescription PropertyName="ID" /></CollectionViewSource.SortDescriptions><CollectionViewSource.GroupDescriptions><PropertyGroupDescription PropertyName="SetName" /></CollectionViewSource.GroupDescriptions></CollectionViewSource>

Thanks in advance,
Jay :)


If you shake a kettle, does it boil faster?

Hiding main window until after authentication takes place..... how to???

$
0
0

Hello,

My initial App.xaml file lists:

   <Application x:Class="IcebergMain.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindowShell.xaml">       

In my MainWindowShell's Loaded method I perform some user authentication.  While it is doing this, the Window's empty frame is displayed and then everything is fully displayed after the Loaded method is completed.  I need to find a way to NOT have this Window frame visible until the authentication is verified.  If authentication fails, I propmpt the user and then call this.close.  I get the behavior I want if I do the authentication in the constructor but I don't want to do that since I only want the defaulted InitializeComponent method to be called there.  The things I have tried include:

1) Set the window's visibility to hidden in the xaml file with the thought of making it visible after the authentication completes in the Loaded method.  The problem I am seeing here is that the Loaded method does not even get called if the visibility is set to hidden.

2) I don't use a StartupUri in the App.xaml file and instead try to create an instance of the window in the App.xaml.cs's constructor.  While that launches the Window, the Application.Resources defined in the App.xaml are not used and there are exceptions when I close the Window (even though I tried to set the ShutDownMode in the App.xaml.cs class.      

3) Tried to set the Window's visibility to hidden at the beginning of the Loaded method with thoughts of resetting it to Visible later but it never did get hidden.

Any thoughts on how to do this in the proper manner would be appreciated. Thanks - Peter Len 

DataGrid with extra column

$
0
0

Hi all,

I have this issue with the datagrid where is adding what seems to be an extra column (or at that's what it seems to me). I have searched the web for a solution without luck. Some suggest to increase the width of the last column, but that is not an option for me. The reason is because the checkboxes are being centered within the column and expanding the last column to the remaining width of the datagrid will cause it to be to far apart from the rest of the columns. Below is an image of what I am describing. I want this white header to have the same style as the rest of the datagrid.

 

Hope somebody can help.

Thanks in advance.

GridView EditItemTemplate

$
0
0

Hello,

I am creating a gridview programmatically. To the gridview, I am adding TemplateFields. These fields have HeaderTemplate, ItemTemplate and EditItemTemplate. 

The issue is, when I bind the data to the gridview, the InstantiateIn event is fired. This event creates the controls for HEaderTemplate and ItemTemplate. But, not control is created for the EditItemTemplate.

Not sure why it does not create a control for EditItemTemplate.

-N

Manipulate DockPanel or some "Panel"

$
0
0

Hi everyone

I've been developing an application (in XAML with C#) with a left menu, like Outlook Office 2007.

I declared a TabControl with its TabItem (there are 3 TabItems) in the XAML code.

I want to link each TabItem with a DockPanel or something like aPanel in the right side of the display. But i don't know how to do it.

This is the code in XAML where i declare the TabControl and its TabItem:

<TabControl x:Name="TabControl" Template="{StaticResource OutlookTab}"><TabItem x:Name="TabItemUno" Header="TabItemUno"></TabItem><TabItem x:Name="TabItemDos" Header="TabItemDos"></TabItem><TabItem x:Name="TabItemTres" Header="TabItemTres"></TabItem></TabControl>

This is the code where i declare the DockPanels:

<DockPanel Grid.Column="1" x:Name="PanelTabItemUno" HorizontalAlignment="Center" VerticalAlignment="Center"><Label>Todo lo relacionado al TabItemUno</Label></DockPanel><DockPanel Grid.Column="1" x:Name="PanelTabItemDos" HorizontalAlignment="Center" VerticalAlignment="Center"><Label>Todo lo relacionado al TabItemDos</Label></DockPanel><DockPanel Grid.Column="1" x:Name="PanelTabItemTres" HorizontalAlignment="Center" VerticalAlignment="Center"><Label>Todo lo relacionado al TabItemTres</Label></DockPanel>

And, here i try to link the selected TabItem with its DockPanel (if i choose the TabItemOne, in the right side appears the DockPanel PanelTabItemUno):

if (TabItemUno.IsSelected)
{
PanelTabItemUno.IsEnabled = true;
}

But, it does not work ... :(

Any idea?

Thanks to all!


How to trigger an event in a view control from a ViewModel

$
0
0

Hi,

I'm having a problem where my DataGrid (bound to an ObservableCollection and having CauUserAddItems=true) relies on the event RowEditEnding to update the NewItem row to display a custon 'click here to add a row' message like so:

private void ExportTargets_RowEditEnding(object sender, DataGridRowEditEndingEventArgs e) { IEditableCollectionView iecv = CollectionViewSource.GetDefaultView( (sender as DataGrid).ItemsSource) as IEditableCollectionView; if (iecv.IsAddingNew) // using invoke/idle causes a wait until after the NewItemPlaceHolder is added Dispatcher.Invoke(new DispatcherOperationCallback(SetEditingNewItemTemplate), DispatcherPriority.ApplicationIdle, sender); e.Row.HeaderTemplate = null; // reset row header } public object SetEditingNewItemTemplate(object arg) { DataGrid dg = (DataGrid)arg; DataGridRow row = GridHelper.GetRow(dg, dg.Items.Count - 1); if (row.Template != _newRowControlTemplate) { row.Template = _newRowControlTemplate; row.UpdateLayout(); }

return null; }

The problem is that the row also contains a browse button, which updates the Data Model directly (i.e. not thru the grid control).  Since the Collection is Observable and the binding Mode=TwoWay, this does update the grid, but the RowEditEnding event never fires (since it never began in this scenario), so the new row teimplate is never updated.

I know the ideal solution would be to port the code-behind to MVVM, but the proper events don't seem to be available from within the ViewModel.

So how to I either inject this event from the ViewModel into the view control so the function is called in the proper context or otherwise somehow directly update the row Template?  Right now I'm tangled up in SyncronizationContext and other issues that prevent the direct approach.

Thanks in advance for any help...


WPF Listbox Virtualization creates DisconnectedItems

$
0
0

I'm attempting to create a Graph control using a WPF ListBox. I created my own Canvas which derives from a VirtualizingPanel and I handle the realization and virtualization of items myself.

The listbox' item panel is then set to be my custom virtualized canvas.

The problem I am encountering occurs in the following scenario:

  • ListBox Item A is created first.
  • ListBox Item B is created to the right of Item A on the canvas.
  • ListBox Item A is virtualized first (by panning it out of view).
  • ListBox Item B is virtualized second (again by panning it out of view).
  • Bring ListBox Item A and B in view (i.e: realize them)
  • Using Snoop, I detect that the ListBox has now 3 items, one of them being a "DisconnectedItem" located directly underneath ListBox Item B.

What causes the creation of this "DisconnectedItem" ? If I were to virtualize B first, followed by A, this item would not be created. My theory is that virtualizing items that precedes other items in a ListBox causes children to be disconnected.

The problem is even more apparent using a graph with hundreds of nodes, as I end up with hundreds of disconnected items as I pan around.

Here is a portion of the code for the canvas:

/// <summary>
/// Arranges and virtualizes child element positionned explicitly.
/// </summary>
public class VirtualizingCanvas : VirtualizingPanel
{
   (...)

    protected override Size MeasureOverride(Size constraint)
    {
        ItemsControl itemsOwner = ItemsControl.GetItemsOwner(this);

        // For some reason you have to "touch" the children collection in order for the ItemContainerGenerator to initialize properly.
        var necessaryChidrenTouch = Children;

        IItemContainerGenerator generator = ItemContainerGenerator;

        IDisposable generationAction = null;

        int index = 0;
        Rect visibilityRect = new Rect(
            -HorizontalOffset / ZoomFactor,
            -VerticalOffset / ZoomFactor,
            ActualWidth / ZoomFactor,
            ActualHeight / ZoomFactor);

        // Loop thru the list of items and generate their container
        // if they are included in the current visible view.
        foreach (object item in itemsOwner.Items)
        {
            var virtualizedItem = item as IVirtualizingCanvasItem;

            if (virtualizedItem == null || visibilityRect.IntersectsWith(GetBounds(virtualizedItem)))
            {
                if (generationAction == null)
                {
                    GeneratorPosition startPosition = generator.GeneratorPositionFromIndex(index);
                    generationAction = generator.StartAt(startPosition, GeneratorDirection.Forward, true);
                }

                GenerateItem(index);
            }
            else
            {
                GeneratorPosition itemPosition = generator.GeneratorPositionFromIndex(index);

                if (itemPosition.Index != -1 && itemPosition.Offset == 0)
                {
                    RemoveInternalChildRange(index, 1);
                    generator.Remove(itemPosition, 1);
                }

                // The generator needs to be "reseted" when we skip some items in the sequence...
                if (generationAction != null)
                {
                    generationAction.Dispose();
                    generationAction = null;
                }
            }++index;
        }

        if (generationAction != null)
        {
            generationAction.Dispose();
        }

        return default(Size);
    }

   (...)

    private void GenerateItem(int index)
    {
        bool newlyRealized;
        var element = ItemContainerGenerator.GenerateNext(out newlyRealized) as UIElement;

        if (newlyRealized)
        {
            if (index >= InternalChildren.Count)
            {
                AddInternalChild(element);
            }
            else
            {
                InsertInternalChild(index, element);
            }

            ItemContainerGenerator.PrepareItemContainer(element);

            element.RenderTransform = _scaleTransform;
        }

        element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
    }


Validation occurs only on TabOut not "Save"

$
0
0

I have a custom control called ValGrid. When I tab out of that control the validation associated with it occurs. But when I click on the save button the validation does not occur.

The xaml looks like this

<corewpf:ValGrid ItemsSource="{Binding Path=Member.Units, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                     Style="{StaticResource StatefulGrid}"
CanUserAddRows="True"
UpdateValidationTrigger="{Binding UpdateValidationTrigger}"
           LabelText="Units"><corewpf:ValGrid.Resources><corewpf:BindingProxy x:Key="proxy" 
       StaticDataContext="{Binding}" /></corewpf:ValGrid.Resources><corewpf:ValGrid.Columns>
                      ........     </corewpf:ValGrid.Columns></corewpf:ValGrid>
What should I do so that the validation occurs when I click the save button not just when I tab out of the control

MediaElement Position issue:

$
0
0

There are similar issue related to MediaElement.Position property like the on the following thread:

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/ebbbca48-1b19-425a-a757-c9108bb6de02/

But my problem is a bit different.

ScrubbingEnabled is true and I've a slider which can be used to seek video. now whenever I seek the near the end of the video or sometimes to the end, MediaElement dose not respond, like it's hanged without any error event, it dose not even update event if I set it's Position again to starting or somewhere in between, Also in this condition when I play the video again, it seam like it's updating the value of position, but not playing the video. [I am checking the value of Position on timer.]

Only solution left is to load another file.

Thanks in advance...

Are paths/shapes rendered even if they are hidden/collapsed?

$
0
0

Hi,

My application is loading very slow and I am trying to improve the performance.

One interesting thing which I came across is the render time taken by WPF.

I have a lot of shapes (running into hundreds) but most of then initially hidden/collapsed.

Will WPF spend any time on those? My understanding is that nothing is rendered unless it is visible!

Thanks in advance :)


Please Mark as Answered If this answers your question OrUnMark as Answered if it did not.
Happy to Help :)
My Site

DataGridTextColumn MultiBinding with ElementName works not all machines - DependencyProperty.UnsetValue

$
0
0

Today, I got a crazy behaviour. My multibinding works on one machine but on another I got DependencyProperty.UnsetValue. 

Machine 1:

Win8 works fine

Machine 2:

Win7 got DependencyProperty.UnsetValue

Here is my XAML:

<StackPanel Margin="10" Orientation="Horizontal"><TextBlock VerticalAlignment="Center" Margin="10" Text="Steuer: " /><ComboBox Name="ComboSteuer" ItemsSource="{Binding Steuern}" SelectedIndex="0" HorizontalContentAlignment="Stretch"  Width="100" Margin="10" /></StackPanel><DataGrid
            SelectionMode="Extended"
            SelectionUnit="FullRow"
            RowHeaderWidth="0"
            IsReadOnly="True"
            ItemsSource="{Binding Books}"
            AutoGenerateColumns="False"><DataGrid.Columns><DataGridTextColumn Header="Title" Binding="{Binding Title}" Width="*" /><DataGridTextColumn Header="Autor" Binding="{Binding Author}" Width="*" /><DataGridTextColumn Header="Netto" Binding="{Binding NetPrice, StringFormat=' {0} €'}" Width="Auto" /><DataGridTextColumn Header="Steuer"><DataGridTextColumn.Binding><MultiBinding StringFormat=' {0:f} €' Converter="{multiDataBindingSample:SteuerConverter}"><Binding ElementName="ComboSteuer" Path="SelectedValue" /><Binding Path="NetPrice" /></MultiBinding></DataGridTextColumn.Binding></DataGridTextColumn>

And my converer for the MultiBinding looks:

 public class SteuerConverter : MarkupExtension, IMultiValueConverter
    {
        private SteuerConverter _bruttoConverter;

        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            double steuer =0;
            if (Double.TryParse(values[0].ToString(), out steuer))
            {
                double netto = Double.Parse(values[1].ToString());

                return netto/100*steuer;
            }

            
            return values[1];
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            return default(object[]);
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return _bruttoConverter ?? (_bruttoConverter = new SteuerConverter());
        }
    }

I know the could could be nicer ;-)

Machine 2 with Win7

Machine 1 with Win8

Framework is 4.0. Some help would be nice.

Kind Regards,

Dany

Windows Form vs WPF binding walkthrough

$
0
0

Hi. I was trying to repeat the simple scenario where you bind 3 properties of an object to 3 textboxes using WPF. If you use Windows Form, after adding the data source, you can complete the walkthrough working with the property panel on the right, the designer adds a bindingsource and the object does not need to implement INotifyPropertyChanged, unless you want some stuff done when you set the properties from code behind. If you use WPF, my impression is that it is not possible to complete the walkthrough without adding few lines of code in the XAML file. I mean, you have to define a static resource, after adding a reference to the namespace where the object is. So, you can complete the walkthrough working more or less as in the Windows Form scenario, even if you have to implement the INotifyPropertyChanged in the class from which you create the object. However, I can understand it, because after adding the resource in the XAML, you have to catch it from code behind and set the properties from there, a scenario quite similar to the Windows Form scenario when you want the textboxes updated if you set the properties programmatically from code behind. I would like to know if my digression is correct and if it is possible to add a reference to the namespace where the object is and to add the static resource, both in XAML, during design time, without having to write few lines of code in the XAML itself. I know that it is possible working on the data source panel on the left, dragging and dropping, but I would like to repeat the walkthrough in tha same way I would in a Windows Form scenario, working on the property panel of the textboxes on the right. Thanks.



Hang in unknown location in a very complex WPF application when windows layout changed because of creating ReportViewr in another thread

$
0
0

I have a WPF application with a very complex XAMLs, I need a way to know the point that my application hang on, when I try to pause the execution, the application seems to not be hanging, the pointer will be on this line:

System.Windows.Application myApp;
.
.
.
.
myApp.Run(); // <== this line

This is happening when I change the layout of the task bar or when windows explorer crashed (the task bar is hidden), if I do those changes in a heavy repetition, the application will never recover, but when a small change done, the application will recover after minutes, I need to know the cause of this issue, I doubt in the complex XAMLs of my application, but I need a way to know the page or the component, or the whatever the source of this hang.

I need a tool or a way to know what is the XAML that consuming the dispatcher time!


JSON parsing

$
0
0

Hi, This is json result which got from api, can anybody tell me how i deserialize it and bind to Listbox

{
    "api": "getplayerlist",
    "status": "success",
    "message": "Player Details",
    "playerList": [{
        "playerFirstname": "hiren",
        "playerLastname": "raval",
        "playerGender": "male",
        "playerGameplaycount": "1",
        "playerGamewinncount": "0",
        "playerTournamentplaycount": "0",
        "playerTournamentwincount": "0",
        "playerProfileimage": "http:\/\/demo3.idhasofthealth.com\/playgameprize\/web\/images\/noimage.jpg"
    }, {
        "playerFirstname": "shrikant",
        "playerLastname": "shukla",
        "playerGender": "male",
        "playerGameplaycount": "0",
        "playerGamewinncount": "0",
        "playerTournamentplaycount": "0",
        "playerTournamentwincount": "0",
        "playerProfileimage": "http:\/\/demo3.idhasofthealth.com\/playgameprize\/web\/images\/noimage.jpg"
    }, {
        "playerFirstname": "vikram",
        "playerLastname": "pawar",
        "playerGender": "male",
        "playerGameplaycount": "1",
        "playerGamewinncount": "0",
        "playerTournamentplaycount": "0",
        "playerTournamentwincount": "0",
        "playerProfileimage": "http:\/\/demo3.idhasofthealth.com\/playgameprize\/web\/images\/noimage.jpg"
    }]
}

Shivendra Bokade


how to design the transportation website for a college

$
0
0
i am developing a college website for transport purpose what design interface should i use and what features should i include in it. i am not getting any idea how to start it as i am doing this for the first time please help

Validation of textboxes , WPF MVVM

$
0
0

Hi Guys,

I would like to know, how can i validate the textboxes in the UI. When the user click on the button, if there any textbox is empty, I want to display as a error message, display error message for wrong data type??

This test project works, but i would like to know how can i implement 'validation'?? i am so grateful for your help & time. Thank you.

Model:Customer 

namespace MVVMKarthik.Model
{
    [Serializable()]
    public class Customer : INotifyPropertyChanged
    {

        private string firstName;
        public string FirstName
        {
            
            get { return firstName; }

            set
            {
                
                    firstName = value;
                
                OnPropertyChanged("FirstName");
            }
        }

        private string lastName;
        public string LastName
        {
            get { return lastName; }
            set
            {
                lastName = value;
                OnPropertyChanged("LastName");
            }
        }

        private string address;
        public string Address
        {
            get { return address; }
            set
            {
                address = value;
                OnPropertyChanged("Address");
            }
        }

        private int mobile;
        public int Mobile
        {
            get { return mobile; }
            set
            {
                mobile = value;
                OnPropertyChanged("Mobile");
            }
        }

        private string country;
        public string Country
        {
            get { return country; }
            set
            {
                country = value;
                OnPropertyChanged("Country");
            }
        }

        /// <summary>
        ///  Empty Constructor
        /// </summary>

        public Customer()
        {
            
        }

        public Customer(
            string FName, string LName, string Addr, int Mob, string Count)
        {
            FirstName = FName;
            LastName = LName;
            Address = Addr;
            Mobile = Mob;
            Country = Count;
        }


        #region INPC

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

   
    }
}

CustomerViewModel:

using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Xml.Serialization;
using MVVMKarthik.Commands;
using MVVMKarthik.Model;
using MVVMKarthik.View;

namespace MVVMKarthik.ViewModel
{
   internal class CustomerViewModel
   {

       public CustomerViewModel()
       {
           Customer = new Customer();
           UpdateCommand = new CustomerUpdateCommand(this);
          

       }

       /// <summary>
       /// Gets the Customers instance
       /// </summary>
       public Customer Customer { get; private set; }

       /// <summary>
       /// Get the updated command for the viewModel
       /// </summary>
       public ICommand UpdateCommand
       {
           get;
           private set;
       }


       public void SaveChanges()
       {

           SerializeToXML(Customer);
        }

        private void SerializeToXML(Model.Customer customer)
        {
            var serializer = new XmlSerializer(typeof(Customer));
            TextWriter textWriter = new StreamWriter(@"C:\test\vie.xml");
            serializer.Serialize(textWriter, customer);
            textWriter.Close();
        }

ICommands:

using System.Windows.Input;
using MVVMKarthik.ViewModel;

namespace MVVMKarthik.Commands
{
    internal class CustomerUpdateCommand : ICommand
    {
        private CustomerViewModel customerViewModel;
        
        public CustomerUpdateCommand(CustomerViewModel customerViewModel )
        {
            this.customerViewModel = customerViewModel;
            
        }

        public void Execute(object parameter)
        {
            customerViewModel.SaveChanges();

        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }

        }


    }
}

XAML:

<Window x:Class="MVVMKarthik.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="300" Width="429"><Grid Width="267"><Label Content="First Name :" Height="28" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" /><Label Content="Last Name :" Height="28" HorizontalAlignment="Left" Margin="0,37,0,0" Name="label2" VerticalAlignment="Top" Width="82" /><Label Content="Address : " Height="28" HorizontalAlignment="Left" Margin="0,71,0,0" Name="label3" VerticalAlignment="Top" /><Label Content="Mobile :" Height="28" HorizontalAlignment="Left" Margin="0,105,0,0" Name="label4" VerticalAlignment="Top" /><Label Content="Country : " Height="28" HorizontalAlignment="Left" Margin="0,139,0,0" Name="label5" VerticalAlignment="Top" /><TextBox Height="23" HorizontalAlignment="Left" Margin="79,5,0,0"   Text="{Binding Customer.FirstName, UpdateSourceTrigger=PropertyChanged}"  VerticalAlignment="Top" Width="120" /><TextBox Height="23" HorizontalAlignment="Left" Margin="79,37,0,0"  Text="{Binding Customer.LastName, UpdateSourceTrigger=PropertyChanged}"  VerticalAlignment="Top" Width="120" /><TextBox Height="23" HorizontalAlignment="Left" Margin="79,71,0,0"  Text="{Binding Customer.Address, UpdateSourceTrigger=PropertyChanged}"   VerticalAlignment="Top" Width="120" /><TextBox Height="23" HorizontalAlignment="Left" Margin="79,110,0,0" Text="{Binding Customer.Mobile, UpdateSourceTrigger=PropertyChanged}"    VerticalAlignment="Top" Width="120" /><TextBox Height="23" HorizontalAlignment="Left" Margin="79,144,0,0" Text="{Binding Customer.Country, UpdateSourceTrigger=PropertyChanged}"   VerticalAlignment="Top" Width="120" /><Button Content="Verify Me" Height="23" HorizontalAlignment="Left" Margin="21,187,0,0" Command="{Binding UpdateCommand}" VerticalAlignment="Top" Width="120" 
                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FF008D73" /></Grid></Window>


How to disable Charms (windows 8)- Using Application in Touch screens like KIOSKs,

$
0
0

Hi,

    Disable chars in windows 8 for our Kiosk style framework.   

    I have read that many recommended to use Windows 8 embedded but this is not an option for us. Our clients are inquiring tablets, all in one touch screens and touchscreen with laptop that use our platform to put in events. The issue here is that previously our app was able to control what was running (top most, windows XP and 7) and was the ONLY app running but now with Charms in windows 8 it is impossible to control because of charms. We have not migrated to Metro Style yet as our Framework is very big.

   Our clients later use the same tablets for Office operations so they have DUAL purpose because it also helps justify the investment.

    SO you can see now with Windows 8, the solution is placed in events that are public and they DON'T want the users of the platform to leave and use something else, like IE, Skype, Etc. 

   So we need a way to get our app to be the only one running when it is executed and have no ability to leave it unless it is by the exit on the app (controlled exit with password). All pour clients are acquiring the new windows 8 tablets as we have recommended it but now we have this big problem...

   We really need help...

Kind Regards

Lucas Sain

How to disable Charms (windows 8)- Using Application in Touch screens like KIOSKs,

$
0
0

Hi,

    Disable chars in windows 8 for our Kiosk style framework.   

    I have read that many recommended to use Windows 8 embedded but this is not an option for us. Our clients are inquiring tablets, all in one touch screens and touchscreen with laptop that use our platform to put in events. The issue here is that previously our app was able to control what was running (top most, windows XP and 7) and was the ONLY app running but now with Charms in windows 8 it is impossible to control because of charms. We have not migrated to Metro Style yet as our Framework is very big.

   Our clients later use the same tablets for Office operations so they have DUAL purpose because it also helps justify the investment.

    SO you can see now with Windows 8, the solution is placed in events that are public and they DON'T want the users of the platform to leave and use something else, like IE, Skype, Etc. 

   So we need a way to get our app to be the only one running when it is executed and have no ability to leave it unless it is by the exit on the app (controlled exit with password). All pour clients are acquiring the new windows 8 tablets as we have recommended it but now we have this big problem...

   We really need help...

Kind Regards

Lucas Sain

Set EndDate on 1 or 2 day later then StartDate

$
0
0

HI All.

I'm using that code to prevent to select EndDate early then StartDate

<DatePicker Name="EndDatePicker" DisplayDate="{Binding SelectedDate, ElementName=StartDatePicker}" />

Is it possible to modify that code that selected EndDate bedinning on 1 or 2 days later then StartDate?

Thanks.

Viewing all 18858 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>