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

Windows Media Player Live TV Support on windows 7 onwards

$
0
0

Hi Team,

We want the Live TV Streaming in windows media player on Windows XP, Windows 7,8 onwards platform.

We are developing the WPF Application with Windows media player(Activex Control) to streaming the Live TV channels.

Please suggest what will be all configuration or what we will do the supported formats.

Please kindly reply ASAP.

Regards,

Santosh


Why Contents of combobox in the listview header disappers in a page,when back from another page,ie,the rebinded value is not visible

$
0
0
Am having a listview with a combobox in its header with header named city. Contents in that combonox are binded in according to the selected State.My Problem is that when its loaded the values in the combobox works properly but, if i move to some other pages and when am back it to the same page values in the conbobox are not visible,ie,the rebinded value is not visible.why this happens?

C++ and WPF

$
0
0

From what I recall you can use C++ with WPF without huge impact is that correct?

In my new application I am thinking of using WPF for the interface and using C++ and DirectX.

The DirectX surfaces would be drawn on the WPF window using the window handle. Can this even work? I need C++ to handle all the DirectShow and realtime callback functions I get from hardware.


bfxtech.com

the name 'point' not current context (is urgent)

$
0
0

the name 'point' not current context

Windows.UI.Xaml.Shapes.Ellipse fence = new Windows.UI.Xaml.Shapes.Ellipse();

MapControl.Children.Add(fence);
MapControl.SetLocation(fence, point);
MapControl.SetNormalizedAnchorPoint(fence, new Point(0.5, 0.5));

Hi I am using expander control ,and i am loading usercontrols in framebody ,but with the expander framebody is also moving.Can we do that expander only hovers over framebody

$
0
0
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
    Title="MainWindow" >
    <Grid>
        <Expander Header="" HorizontalAlignment="Left"   VerticalAlignment="Center"     ExpandDirection="Right"  IsExpanded="True" >
            <telerik:RadMenu ClickToOpen="False" Focusable="True" Name="RadMainMenu"  Orientation="Vertical" Grid.Row="2" VerticalAlignment="Top" >

                <telerik:RadMenu.Background>
                    <LinearGradientBrush  SpreadMethod="Reflect" ColorInterpolationMode="SRgbLinearInterpolation" StartPoint="2,1" EndPoint="4,1">
                        <GradientStop Color="#153252" Offset="0.0" />
                        <!--<GradientStop Color="#A2BFCD" Offset="0.1" />-->
                        <!--<GradientStop Color="#7CCAF8" Offset="0.2" />-->
                        <!--<GradientStop Color="#C1EFFE" Offset="0.3" />-->
                        <!--<GradientStop Color="#7CCAF8" Offset="0.4" />-->
                        <!--<GradientStop Color="#A2BFCD" Offset="0.45" />-->
                        <!--<GradientStop Color="#C1EFFE " Offset="0.5" />-->
                        <!--<GradientStop Color="#7CCAF8" Offset="0.6" />-->
                        <!--<GradientStop Color="#C1EFFE" Offset="0.7" />-->
                        <GradientStop Color="#7CCAF8" Offset="0.7" />
                        <GradientStop Color="#7CCAF8 " Offset="0.8" />
                        <GradientStop Color="#204E82" Offset="0.9"   />
                        <!--<GradientStop Color="#FF3A60AD" Offset="0.528"/>
                    <GradientStop Color="#FF6A85D8" Offset="0.01"/>
                    <GradientStop Color="#FF3464C4" Offset="1"/>
                    <GradientStop Color="#FF202E7E" Offset="1"/>-->
                    </LinearGradientBrush>
                </telerik:RadMenu.Background>
                <telerik:RadMenu.BitmapEffect>
                    <DropShadowBitmapEffect Color="#204E82" />
                </telerik:RadMenu.BitmapEffect>

                <!--<RadialGradientBrush  >
                    <GradientStop Color="#018BD3" Offset="0.1" />
                    <GradientStop Color="#A2BFCD" Offset="0.600" />
                </RadialGradientBrush>
            </telerik:RadMenu.Background>-->
                <!--<telerik:RadMenu.Background>
                <RadialGradientBrush GradientOrigin="0.5,0.5"  Center="0.5,0.5"  RadiusX="0.5" RadiusY="0.69">
                    <RadialGradientBrush.GradientStops>
                        <GradientStop Color="#018BD3" Offset="1" />
                        <GradientStop Color="#A2BFCD" Offset="0.5" />
                        <GradientStop Color="#7CCAF8" Offset="0.1" />
                    </RadialGradientBrush.GradientStops>
                </RadialGradientBrush>
            </telerik:RadMenu.Background>-->

                <telerik:RadMenuItem Header="Radiology Coding" Focusable="True" FlowDirection="LeftToRight" HorizontalContentAlignment="Left" Height="Auto" VerticalContentAlignment="Center" DropDownPlacement="Right" Name="RadmenuRadiology" >

                   
                 
                </telerik:RadMenuItem>

             
               

            </telerik:RadMenu>

        </Expander>
        <Frame x:Name="frameBody" Height="Auto" BorderThickness="1" Grid.Row="2" Grid.Column="2"  ScrollViewer.HorizontalScrollBarVisibility="Auto"  NavigationUIVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Visible" VerticalAlignment="Top" Width=" auto"   
              Padding="0,0,5,0"    ClipToBounds="True" HorizontalAlignment="Center" HorizontalContentAlignment="Center" >
           
        </Frame>
    </Grid>
</Window>

disable accelerator key completely

$
0
0

Hi,

i would like to handly the [alt] key to perform some special operations.
The problem is, the the key-down (and also preview-key down) event is fired only after hitting [alt] twice.
Is there any way to disable this behaviour to catch the click on [alt] after the first hit?

Andreas

Use of MarkupExtensions with templates in wpf

$
0
0

Hi All,

I have created a xaml which has two DataTemplates . Based on user selection one of the data templates is selected .

Each data template has a texblock and three textboxes . Textboxes are using Validation framework to validate the data as shown below.

<TextBox x:Name="TextBox1" Text="{val:ValidationBinding Path=TextBoxContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource ValidatingTextBox}" Width="150" Margin="0,5,0,5" VerticalAlignment="Center"/>

Though the validation bindings are used in xaml, the validation of textboxes is not working as expected. 

I did some research online and found few links which talks about the use of MarkupExtensions with Templates. It seems that it’s a known issue that MarkupExtensions(in this case ValidationBinding) sometimes don’t work with Templates because the bindings do not happen correctly for templates. If ProvideValue() method of MarkupExtension class is not designed to handle this, the bindings do not happen correctly for templates.

Stating from one of the articles:

“Markup extension is evaluated when the template is parsed . But at this time, the textbox control is not created yet, so the ProvideValue method can’t access it… When a markup extension is evaluated inside a template, the TargetObject is actually an instance of System.Windows.SharedDp, an internal WPF class.

For the markup extension to be able to access its target, it has to be evaluated when the template is applied : we need to defer its evaluation until this time. It’s actually pretty simple, we just need to return the markup extension itself from ProvideValue : this way, it will be evaluated again when the actual target control is created.”

I tried using the same solution as mentioned in those links and modified the ProvideValue() but it doesnt work for me.

Has anyone else faced this issue and found a solution?

Thanks,

Mani

Anyway to override a unity registration for testing?

$
0
0

We have the following in out application

container.RegisterType<IWcfCommunicationClient, Client>();

We need to test the application in isolation. So I just would like to override the client with a mockclient. This class will write the write/check the SOAP request/response in testing mode(We have a testing tool to invoke the application and do some automatic tests)

public class MockClient: IWcfCommunicationClient
{
}

There are many resolves for the client in the application. I don't want to touch the part of the code where it already registering the current client. What I would like to do is to do some technique where in the testing mode it always uses the MockClient registration 

So the flow could be

container.RegisterType<IWcfCommunicationClient, MockClient>();
......
container.RegisterType<IWcfCommunicationClient, Client>();//somehow this shouldn't have any effect and the container should return MockClient even after this.


Ideas(even if different way) are appreciated. Thank you







XAML dll used inside an XAML Grid causing WPF (performance profiling tool) render all the content of that dll

$
0
0

Hello there, I'm working on a platform that's developed on XAML files is a huge desktop app and we're in performance time...

It's a really complex App but in resume here is my main problem: We are not happy on the performance of the WPF, It's slow loading the forms takes too long going from one to other (Which works similar to a explorer tabs, multiple App's or pages with different content, so here is the explanation:

We have a master grid that contains multiple elements this is divided in 3 sections, "the header", "the content", "a left hand bar from the top to bottom", and "the footer".

All items excepting the content are loaded by reference to others XAML files that we use for it, and that works really good when We tested at the WPF performance profiling tool, is doesn't render all the items just the one that we select. the content in other way is loaded by .dll (which is basically many dll of some XAML) reference of it that's our "APP'S" (different forms, different content, etc...) We have to keep this situation because We are developing new thinks and We want to incorporate them dynamically without having to rebuild and re-install a software just copy a reference of the dll and point the name to a database and it will be loaded in our App, it's a really complex situation but it works fine event the dynamically load, We defined an user control for each elements and it works but is not the most efficiently as I wrote and I quote myself

"We are not happy on the performance of the WPF, It's slow loading the forms takes too long going from one to other (Which works similar to a explorer tabs, multiple App's or pages with different content)"

We think that's because of the high continuously calls of the UI render it's rendering all the content elements on "the content" when we i.e: put the mouse over an UI element as a button or datagrid elements, We saw this on dirty region of performance profiling tool, so what I need is to know if is the problem of the dynamically load of an XAML dll or it must be other think, such a properties or other thinks.

I have tried with examples but I do not get that behavior (with this I mean I do not get all items being rendered)

Thanks in advance, best regards.

Add XAML views by "add as link"

$
0
0
Hello,
I try add existing XAML view to my project by "add as link" in different Namespace. Problem is - because these views have same name. And when I start Build projekt I have add:

Error    1    The item "......\Demo\Demo.Application\obj\Debug\MainView.g.cs" was specified more than once in the "Sources" parameter.  Duplicate items are not supported by the "Sources" parameter.   Demo.Application

How resolve this problem?

Dependency property descriptor field missing

$
0
0

Hi, I am using a DependencyProperty to add a behavior to a textBox in the ControlTemplate of a ListBox.

This is working fine but resharper underlines the SelectAll dependency property and reports this error:

"Dependency property descriptor field 'SelectAllProperty" missing"

I have been searching the web for an explanation but did not succeed, can anyone please help me?

using System.Windows;
using System.Windows.Controls.Primitives;

namespace Zic.Helpers
{
    public static class TextBoxBehavior
    {
        public static bool GetSelectAll(TextBoxBase target)
        {
            return (bool)target.GetValue(SelectAllAttachedProperty);
        }

        public static void SetSelectAll(TextBoxBase target, bool value)
        {
            target.SetValue(SelectAllAttachedProperty, value);
        }

        public static readonly DependencyProperty SelectAllAttachedProperty =
            DependencyProperty.RegisterAttached("SelectAll", typeof(bool), typeof(TextBoxBehavior), new UIPropertyMetadata(false, OnSelectAllAttachedPropertyChanged));

        static void OnSelectAllAttachedPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            ((TextBoxBase)o).SelectAll();
            ((TextBoxBase)o).Focus();
        }
    }
}

<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="TextBoxTitle" Property="helpers:TextBoxBehavior.SelectAll" Value="True"/></Trigger></ControlTemplate.Triggers>

Message Box Coming a number of times when Tab Selection is Changed.

$
0
0

Hi,

I have been facing an issue with repeated message box coming when a Tab is changed .The issue is not reproducible in a regular fashion or intervals but still the issue exists. The exact scenario is explained below.

I have a tab control with 3 tabs. When I have some invalid data in Tab2 the Tab navigation has to be stopped or the focus should retain in Tab 2 though I I click on Tab1 or Tab2 .
I am handling the data validation in set of Tab1/3  IsSelected property.The below is model xaml and xaml.cs ..

XAML :

<TabControl >
<TabItem x:Name="Tab1" IsSelected="{Binding IsTab1Selected , Mode="TwoWay",UpdateSourceTrigger="PropertyChanged"}" />

<TabItem x:Name="Tab2" IsSelected="{Binding IsTab2Selected , Mode="TwoWay",UpdateSourceTrigger="PropertyChanged"}" />


<TabItem x:Name="Tab3" IsSelected="{Binding IsTab3Selected , Mode="TwoWay",UpdateSourceTrigger="PropertyChanged"}" />
</TabControl>

xaml.cs :


private bool isTab1Selected;
public bool IsTab1Selected
{
get;
set
{
if(value)
{
.......
if(ValidateTab2Data() == false)
{
MessageBox.Show(...........................);
value = false;
}
}
}

}

But in some scenarios or while randomly say playing with tab change from tab2 to tab1/3 the message box is coming number of times and not able to come out of it except closing the app. When tried to investigate the reason I found that either the Tab1/3.IsFocused is true while this comes up.

But actually when IsSelected is set to false by setting the value = false and updating the value the focus should reamin in Tab2 as IsSelected is not updated to true in the set part . Also the behavior doesn't come up when there isn't message box.

Any help on this is appreciated .

About Agile and its Development with Architecture

$
0
0

Hello!

I have some questions about agile.

1.
What is the definition of the product owner? What is her/his responsibility as a product owner?


2.
Who is responsible for retrieving the requirement specification? Is it the scrum master or product owner?


3.
How common is it to use TDD in relation to agile and srum?


4.
Is TDD only used for new development only?


5.
How common is it to use TDD in relation to further development?


6.
Who is responsible for doing the design pattern and software achitecture before doing the agile and scrum approach?


Thank you!

Validating GridView controls

$
0
0

Hello,

I have a ListView with a GridView inside, it contains many controls with its respective Binding.ValidationRules. Users can add as many rows as they want and the validation styles are working correctly. The issue comes when saving, there is one save button for all ListViews controls on the form, I just want the button to disable or show a message saying there is an error if the validation triggers not letting the user save. I was trying something like this but is not working:

<Button Content="Save" x:Name="cmdSave" Click="cmdSave_Click" Margin="2" ><Button.Style><Style TargetType="{x:Type Button}"><Setter Property="IsEnabled" Value="false" /><Style.Triggers><!-- Require the controls to be valid in order to press OK --><MultiDataTrigger><MultiDataTrigger.Conditions><Condition Binding="{Binding ElementName=dgPC, Path=(Validation.HasError)}" Value="false" /><Condition Binding="{Binding ElementName=dgPressures, Path=(Validation.HasError)}" Value="false" /><Condition Binding="{Binding ElementName=dgAirFlows, Path=(Validation.HasError)}" Value="false" /></MultiDataTrigger.Conditions><Setter Property="IsEnabled" Value="true" /></MultiDataTrigger></Style.Triggers></Style></Button.Style></Button>

As you can see I am trying to validate three listviews dgPC, dgPressures and dgAirflows looking if those has errors, it is not working... help!

thanks


paburgos

oftware arhitecture and design pattern

$
0
0

If you have a product backlog containing short explaination of functionality.

Today, you don't have a software architecture and design pattern but you have a product backlog.

My question is:

Who is responsible for creating a software arhitecture and design pattern?

Maybe product owner, scrum master, the scrum team or someone else?


WPF Desktop Application running on MAC

$
0
0

Hi all of you,

Would it be possible to run one WPF desktop app on a Mac computer?

Does anyone know one tool that run or port WPF desktop Visual Basic to the Mac?

Thanks in advance for any input,

Combining columns of different datatables into one datatable

$
0
0

I have a DataSet with different dataTables. Each dataTable has different number of columns, but all the tables have two common column names: lets say column A and column B. How can I generate a new datatable with only these two columns. I used T-SQL inside visual studio to create the tables. I used CollectionViewSource with a resource key in my Window.Resource in order to connect to the tables. I won't mind using other techniques. 

In addition to combining columns of different table, it would be great if I could remove any duplicate rows in the new DataTable as my columns are repeating certain values. At last assigning the DataTable to a new  DataGrid. 

Collapsible, dock-able, and resizable Visual Studio like panes realization example in WPF

$
0
0

Dear Gurus!

Is there  any library for realization of Collapsible, dock-able, and resizable (Visual Studio like) panes in WPF with using PRISM ?  There is an example , but it don't work with PRISM.


How to disable minimize button of a window using wpf

$
0
0
Hi
I want to disable only minimize button of a wpf window.How can I do that? I searched about it but didn't get any useful material.
Thank you.

VB.NET General Design Decisions

$
0
0

Hi all, I'm new to WPF and somewhat new to .net after coming from a long background in VB6 and MS Access VBA.

I am currently in the fortunate position where I have been assigned a project on a "deliver as when basis" so I have time to get up to scratch on .net and wpf. My day job is as a pControl developer. This is basically an STP system which takes a vast amount of business data, combines and transforms it and runs various levels of business logic over the transformed data. My job is basically writing the rules for the business flows.

Users interact with this transformed data in various ways. We also provide substantial support to this and the way currents users log issues is not fit for purpose over the longer term. Hence I have been asked to create a new support system to capture issues and development requests. I could do this in MS Access in about a month but that's not a challenge and won't provide the quality of solution I am after hence I am going to use VB.Net with WPF.

One of the interesting concepts I have got my head around (just) is databinding. So I basically have learnt how to query the source DB using EF and then bind the WPF form direct to the class using XAML. All good and seems quite clean, however it just does not seem quite right to me.

What I would prefer to do is to bind the wpf form to an instance of the class rather than to the class itself so that I can use the object through my project. This is an approximation of what I have at the moment, I don't have my actual code to hand but functionally its does the same thing:

Imports System.Collections.ObjectModel
Imports System.ComponentModel
Namespace comboboxBinding

    Public Class ViewModel
        Implements INotifyPropertyChanged

        Public Sub New()
            'EF qry is here

            For Each res In qry
                Persons.Add(Person)
            Next

        End Sub
        Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
        Public Property Persons As New ObservableCollection(Of Person)

        Private _SelectedPerson As Person
        Public Property SelectedPerson As Person
            Get
                Return _SelectedPerson
            End Get
            Set(ByVal value As Person)
                _SelectedPerson = value
                OnPropertyChanged("Name")
            End Set
        End Property

        Protected Sub OnPropertyChanged(ByVal name As String)
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(name))
        End Sub
    End Class


End Namespace

And the xaml:

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:WpfApplication4.comboboxBinding"
    Title="MainWindow" Height="Auto" Width="525" mc:Ignorable="d"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    d:DesignHeight="300" SizeToContent="Height"><Window.Resources><local:ViewModel x:Key="PersonsViewModel"></local:ViewModel><ObjectDataProvider x:Key="PersonsSource" ObjectInstance="{StaticResource PersonsViewModel}"></ObjectDataProvider></Window.Resources><Grid DataContext="{StaticResource PersonsSource}" Height="150" Width="450"><Grid.RowDefinitions><RowDefinition Height="50" /><RowDefinition Height="50" /><RowDefinition Height="50" /></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width="150" /><ColumnDefinition Width="150" /><ColumnDefinition Width="150" /></Grid.ColumnDefinitions><TextBlock Height="15" Text="Bind to person by object:" FontWeight="Bold" /><ComboBox Grid.Column="1" Grid.Row="1"    Name="cboBindByObject"
                  ItemsSource="{Binding Path=Persons}"
                  DisplayMemberPath="Name"
                  SelectedItem="{Binding Path=SelectedPerson}"
                  /></Grid></Window>

What I really want to do is to bind to an instance of ViewModel rather than to ViewModel itself. In other words say I would want to hold all my instantiated ViewModel objects in a separate class and then bind to those rather than bind to the class which itself does the instantiating!?

In VB6 you could do something like this in a separate module:

Public myViewModel as ViewModel

Set myViewModel = new ViewModel

Which would make myViewModel available to the entire project. This does not seem like good practice in .Net neither can I seem to do it properly.

I maybe worrying too much but it just seems better to bind to an object instance rather than the class itself? Any ideas or am I missing the point.

cheers

Viewing all 18858 articles
Browse latest View live


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