|
Hi, i am using this method only. But it is applicable for Page navigation only.I want window navigation.
Gomathi R
|
|
|
|
|
GomathiR wrote: But it is applicable for Page navigation only
No it's not. A standard Windows application can show a Dialog. What you could do - and this is a hack, is show the login dialog before you call InitializeComponent(); in the window class. Then, call Application.Shutdown(); if the login fails.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Thanks Pete. But now i am looking at another serious problem. I am using infra grid in my page. I want to perform edit operation in it. I found a method which works only when "Select *" is used.And also it displays two objects in the grid.
Any idea regarding this.very urgent
Gomathi R
|
|
|
|
|
I don't use the Infra grid, so I can't help you on this. If you can't figure it out, you should raise this on the Infragistics support forums - they are the best place to figure vendor specific issues out.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
please send some sample project for Role-base authorization i.e secure login page with roles ...
thanks in advance..
Ramkumar(senior pgmr)
|
|
|
|
|
|
Hi All,
I have just started playing with this for the first time. I have set up a Class that inherits from ValidationRule and just popped a Console.WriteLine in there for now ... anyone know why this isn't being invoked?
<ComboBox.ItemsSource>
<MultiBinding Converter="{StaticResource BestGuessFieldLabelDropDownListConverter}"
UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True">
<MultiBinding.ValidationRules>
<l:MappingValidationRule/>
</MultiBinding.ValidationRules>
<Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type wizard:Wizard}}" Path="DataContext.SelectedDataMapping" />
<Binding RelativeSource="{RelativeSource self}" />
<Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type wizard:Wizard}}" Path="DataContext.AnalyseResults" />
</MultiBinding>
</ComboBox.ItemsSource>
|
|
|
|
|
The Validation fires when the binding to Source is being updated. More clearly stated in MSDN,
"Validation usually occurs when the value of a target is transferred to the binding source property. This occurs on TwoWay and OneWayToSource bindings. To reiterate, what causes a source update depends on the value of the UpdateSourceTrigger property, as described in the What Triggers Source Updates section." Link[^]
You might want to have a look here[^] also.
|
|
|
|
|
Indeed. Whilst I was debugging I came to this conclusion! Thanks for the reply.
Seems this is not the droid I was looking for ...
|
|
|
|
|
I'm writing a listview:
<StackPanel Margin="8">
<ListView Name="listView" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Age" DisplayMemberBinding="{Binding Age}" />
<GridViewColumn Header="Grade">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Grade}" Foreground="{Binding GradeColor}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
The foreground color of column 'Grade' is decided by the property GradeColor. It can be Green, Yello and Red.
When I select an item in the listview, the background color of the selected item turned to blue, and the foreground color of the first two column turned to white, but the foreground of the 'Grade' column didn't change to white, which cause the text is unreadable when the item is selected.
Is there any way that I can make the foreground of the 'Grade' column to be white like the other columns when the item is selected? Thx!
|
|
|
|
|
I think maybe this[^] will help you. It uses a standard listbox but I think it would work for the listview also.
|
|
|
|
|
Hi Ray, thanks for your reply. I made some changes on the TextBlock and fixed the problem.
<StackPanel Margin="8">
<ListView Name="listView" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Age" DisplayMemberBinding="{Binding Age}" />
<GridViewColumn Header="Grade">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Grade}">
<TextBlock.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListViewItem}}}" Value="False">
<Setter Property="TextBlock.Foreground" Value="{Binding Path=GradeColor}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
|
|
|
|
|
I want to do it with out writing a code ( write only in the xaml ).
I remember that i done it once but i dont remember how i did it.
|
|
|
|
|
Take a look at Style triggers[^]. Hope that refreshes your memory.
Looking at the your questions, I think you should read a WPF book before you continue with whatever you are doing.
Edit - Also, having your question in the subject of the post is not a good way of posting your questions.. If you want help, learn to respect the people who will be helping you.
|
|
|
|
|
i created a silverlight project,and add some TextBox control on it,but i want to format the string which put into the TextBox,for example the length,and ASCII or Unicode,But how could i achieve it,any one help me!
Thank you in advance.
|
|
|
|
|
Where's the string coming from?
You can do anything you want to the string before setting it as
a textbox's text.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You may want to look into using Converters. Do a msdn search on IValueConvert and you should find examples.
|
|
|
|
|
can we use silverlight in visual studio 2005?
Ramkumar(senior pgmr)
modified on Monday, March 9, 2009 6:22 AM
|
|
|
|
|
getramonweb wrote: can we use silverlight in visual studio 2005?
Probably, but you'll have to do everything manually - there won't be any
app/library templates or intellisense.
If you Google "silverlight 2 visual studio 2005" there's some possibilities -
some are old and I don't know if any work for Silverlight 2 RTM.
Why not get a free edition of VS 2008: Microsoft Visual Web Developer 2008 Express with SP1[^]
Then you can use all the latest stuff for Silverlight 2 as listed here:
Get Started Building Silverlight 2 Applications[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
We have used C1DateEdit control(Component One third party control) in WPF application and it has some issue with it.
Please find below the scenario and the issue.
Scenario 1:
Step 1 : Create a WPF-Windows application and add Window1.xaml .
Step 2 : Add C1DateEdit control in WindowsFormsHost element.
Step 3 : Execute the application.
Step 4 : Click on the dropdown of the DateEditControl. It throws the below exception.
Scenario2:
Step 1 : Create a WPF-Windows application and add Window1.xaml .
Step2: Create a usercontrol(ucDateTimePicker.cs) by adding C1DateEdit control.
Step3: Add the user control in WindowsFormsHost element of Window1.xaml.
Step 4 : Execute the application.
Step 5 : Click on the dropdown of the DateEditControl. It throws the below exception.
Expected Result:
When click on the dropdown of the DateEditControl, it should drop the calendar.
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at C1.Win.C1Input.C1DropDownControl.OpenDropDown()
at C1.Win.C1Input.C1DropDownControl.a()
at C1.Win.C1Input.C1DropDownControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Note: The same scenario works well with Windows application of visual studio 2005.
Kindly provide the idea/solution for this issue as early as possible.
|
|
|
|
|
Have you had a thought that this could be an overlay issue ? When your Calendar control is trying to open it is entering the WPF space and hence must be dying out.
Did you ask this in the Component1 forum ?
|
|
|
|
|
jaylinuxguru wrote: Kindly provide the idea/solution for this issue as early as possible.
That's simple. Raise this with the company that supplied the product. They are the ones who ultimately get paid to fix bugs. Posting this on a random site does nothing to help improve the quality of the control - Component1 support staff aren't monitoring CP hoping to see support calls coming in here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Hi,
I have a contextmenu defined and binded the IsEnabled property for some items. This is (part of) the code:
<Window x:Class="PAP.PhotoAnnotation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:PAP.Controls"
WindowState="Maximized"
Title="{Binding Path=Title, ElementName=canvasContainer, Mode=OneWay}">
<Window.Resources>
<!-- Converts tooltype to bool for checking controls -->
<controls:ConverterActiveElement x:Key="convActiveElement"/>
</Window.Resources>
<Grid>
<DockPanel>
<ScrollViewer Name="container" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<controls:CanvasContainer x:Name="canvasContainer" Background="LightGray">
<controls:CanvasContainer.ContextMenu>
<ContextMenu x:Name="contexMenu">
<MenuItem Header="Undo"/>
<MenuItem Header="Redo"/>
<Separator/>
<MenuItem Header="Cut"/>
<MenuItem Header="Copy"/>
<MenuItem Header="Paste"/>
<MenuItem Header="Delete"/>
<Separator/>
<MenuItem Header="Select All"/>
<Separator/>
<MenuItem Header="Bring Forward"
Click="BringForward_Click"
IsEnabled="{Binding Path=ActiveElement, ElementName=canvasContainer,
Mode=OneWay, Converter={StaticResource convActiveElement}}"/>
<MenuItem Header="Send Backward"
Click="SendBackward_Click"
IsEnabled="{Binding Path=ActiveElement, ElementName=canvasContainer,
Mode=OneWay, Converter={StaticResource convActiveElement}}"/>
<Separator/>
<MenuItem Header="Properties"/>
</ContextMenu>
</controls:CanvasContainer.ContextMenu>
<!-- Add children in code to populate canvas -->
</controls:CanvasContainer>
</ScrollViewer>
</DockPanel>
</Grid>
</Window>
The problem is that this does not work. It just allways stays enabled. I also binded some buttons in a toolbar and menu-items in a normal menu EXACTLY the same and that works perfect !
Anyone an idea of what is wrong?
Thx!
|
|
|
|
|
ContextMenu is not part of Visual and Logical tree. You will need to do something like this[^] ?
|
|
|
|
|
Good People,
Quick question. I have a collection of objects which will, within each, have a series data that needs to be displayed. Say for example, I have a GasStation object which I will put in an observable collection called AllGasStations. As you can imagine, I need to track several things each day, e.g. customers, gallons used, profit, items sold - which I will put in an object called DailyActivity and then place that into an observable collection called AllDailyActivity.
I am using a XamChart (infragistics) that needs a series. So, does WPF support binding to a collection within a collection. I want to display a chart for each day, for each gas station. So, can it bind to the gas stations collection, then each chart that comes up can bind to the AllDailyActivity collection within the GasStation Collection.
Using a listbox, I am thinking that I would use the gas station object as the data context, bind the gas station name to the template's gas station name, then bind the chart to the AllDailyActivity collection within the gas station object. Any thoughts?
Thanks for any help or information you can provide.
Blitz
|
|
|
|