|
I would think that you would want to do this
<Frame>
<ScrollViewer>
<Page/>
</ScrollViewer>
</>Frame
After all you want the pages to scroll not the frame right?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
I haven't found a solution for this yet, probably a lack of Google skills, but how can I update the contents in a richtextbox in wpf from a different thread?
There is not Invoke or BeginInvoke on the control so delegates won't work?
And using a delegate in this way:
this.Dispatcher.Invoke(DispatcherPriority.Normal, new AddTextDelegate(_AppendtextLine), null, new object[] { text });
only makes the application hang.
Any good ideas on this?
|
|
|
|
|
|
Unfortunately, that won't help.
Since i'm already on another thread when recieving the event, that's nothing I can control.
The problem is access to the controls on the main thread when an event is recieved.
|
|
|
|
|
Is is possible to host .NET 2.0 controls in WPF on .NET 3.0?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Yes. .NET 3/3.5 is a superset of the capabilities of 2, so you can host 2.0 controls in WPF.
|
|
|
|
|
Thanks for the reply.
Do you perhaps know how to do it ?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
|
Ok, So I'm trying to programatically set the left margin on three controls, a textblock named "Clock", a StackPanel named "TasksIcos", and a button named "Options". This is the code I'm using:
<br />
TasksIcos.Margin = New Thickness(TasksIcos.Margin.Left + 32, TasksIcos.Margin.Top, TasksIcos.Margin.Right, TasksIcos.Margin.Bottom)<br />
Options.Margin = New Thickness(-MiniModePanel.Width + 43, Options.Margin.Top, Options.Margin.Right, Options.Margin.Bottom)<br />
Clock.Margin = New Thickness(Clock.Margin.Left + 43, 0, -7, 0)
The only one that moves any at all, is "Options". The other two do not move regardless of what the values are entered.
Can a WPF guru tell me what I'm doing wrong here?
|
|
|
|
|
I'm spitballing, but what is the value of TaskIcos.Margin when this code runs? Is it null? If so, that is your problem.
Step through your code and see what is actually getting created.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
TasksIcos.Margin.Left = -192 at runtime and in blend.
|
|
|
|
|
Can you post the XAML that these controls are in? This will help me get context so I can create my own test application.
BTW: When does this above code run?
Can you please post the entire method that these assingments run in.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Actually, I figured out not 10 mins after my last post. It seemed to be something with the animation that plays right before any of the actual code is run. I re-did the animation after screwing it up doing something else, and everything seemed to start moving when it supposed to.
Thanks for your help though, and I apologize if I wasted your time.
|
|
|
|
|
Glad you got it all working!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
XML Data :
<?xml version="1.0" encoding="utf-8" ?>
- <ControlData>
- <Companies>
- <Company ID="100" LocationID="2000">
- <CustomerWindow>
<Email Visibility="Hidden" />
</CustomerWindow>
</Company>
- <Company ID="200" LocationID="2000">
- <CustomerWindow>
<Email Visibility="Hidden" />
</CustomerWindow>
</Company>
- <Company ID="300" LocationID="1000">
- <CustomerWindow>
<Email Visibility="Visible" />
</CustomerWindow>
</Company>
- <Company ID="200" LocationID="1000">
- <CustomerWindow>
<Email Visibility="Visible" />
</CustomerWindow>
</Company>
</Companies>
</ControlData>
public partial class CustomerDetails : Window
{
CollectionViewSource cvs = new CollectionViewSource();
XmlDataProvider dp = new XmlDataProvider();
public CustomerDetails()
{
InitializeComponent();
}
private void Binding()
{
CollectionViewSource vs = this.FindResource("MyCollectionView") as CollectionViewSource;
vs.View.CurrentChanged+=new EventHandler(view_CurrentChanged);
ControlDataViewModel cdvm = new ControlDataViewModel();
XmlDocument dc = new XmlDocument();
dc.LoadXml(cdvm.XmlData);
dp.Document = dc;
dp.XPath = "ControlData/Companies";
cvs.Source = dp;
cvs.Filter += new FilterEventHandler(cvs_Filter);
//Binding Expression
Binding bind = new Binding();
bind.Source = cvs;
bind.XPath = "Company/CustomerWindow/Email/@Visibility";
//Find the Email Control and binds.
ContentPresenter cp = VisualTreeHelper.GetChild(Details, 0) as ContentPresenter;
DataTemplate dat = Details.ContentTemplate;
StackPanel sp = dat.FindName("Test", cp) as StackPanel;
TextBlock tb = sp.FindName("EMail") as TextBlock;
tb.DataContext=cvs.View;
tb.SetBinding(TextBlock.VisibilityProperty, bind);
}
void cvs_Filter(object sender, FilterEventArgs e)
{
CollectionViewSource vs = this.FindResource("MyCollectionView") as CollectionViewSource;
Customer cust = vs.View.CurrentItem as Customer;
XmlElement xdoc = e.Item as XmlElement;
XmlNode node = xdoc.SelectSingleNode("Company[@ID='" + cust.CompanyID + "' and @LocationID='" + cust.LocationID + "']");
if (node != null)
{
e.Accepted = true;
}
else
{
e.Accepted = false;
}
}
void view_CurrentChanged(object sender, EventArgs e)
{
cvs.View.Refresh();
}
private void CustomerWindow_Loaded(object sender, RoutedEventArgs e)
{
Binding();
}
}
XAML :
<Window
x:Class="XamDataGridCurrentItemSync.CustomerDetails"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igDP="http://infragistics.com/DataPresenter"
xmlns:local="clr-namespace:XamDataGridCurrentItemSync"
Title="Control Data Collection"
Width="400" Height="550"
WindowStartupLocation="CenterScreen" x:Name="CustomerWindow" Loaded="CustomerWindow_Loaded">
<Window.Resources>
<ObjectDataProvider x:Key="MyCustomers" ObjectType="{x:Type local:CustomerViewModel}" />
<CollectionViewSource x:Name="CVS" x:Key="MyCollectionView" Source="{Binding Source={StaticResource MyCustomers},Path=CustomerDataCollection}" />
</Window.Resources>
<Grid>
<StackPanel>
<Border BorderBrush="Black" BorderThickness="2">
<ListView Name="ListViewCustomerDetails" Margin="4,20,40,100" ItemsSource="{Binding Source={StaticResource MyCollectionView}}" IsSynchronizedWithCurrentItem="true">
<ListView.View>
<GridView>
<GridViewColumn Header="First Name" DisplayMemberBinding="{Binding Path=FirstName}"/>
<GridViewColumn Header="Last Name" DisplayMemberBinding="{Binding Path=LastName}"/>
<GridViewColumn Header="EMail" DisplayMemberBinding="{Binding Path=EMail}"/>
</GridView>
</ListView.View>
</ListView>
</Border>
<ContentControl Content="{Binding Source={StaticResource MyCollectionView}}" x:Name="Details">
<ContentControl.ContentTemplate>
<DataTemplate x:Name="Template1">
<StackPanel Margin="20" x:Name="Test">
<TextBlock x:Name="FirstName" Text="{Binding Path=FirstName}" Height="30" />
<TextBlock x:Name="LastName" Text="{Binding Path=LastName}" Height="30" />
<TextBlock x:Name="EMail" Text="{Binding Path=EMail}" Height="50" />
</StackPanel>
</DataTemplate>
</ContentControl.ContentTemplate>
</ContentControl>
</StackPanel>
</Grid>
</Window>
I am binding the Customers to the ListView and contentControl.It works fine.Also i am binding SecurityData which says whether the Email is visible for an customer based on the companyID and LocationId.I have the securitydata in the Xml format.It is binding well for the first record when i navigate between records it is not reapplying the binding based on the filtered data.Please go through the code and give your suggestion why it is not working.
modified on Thursday, October 30, 2008 7:57 PM
|
|
|
|
|
It seems from everything I've been told and seen so far that you can't access a sql server through anything, but WCF. Is that really true?
The application arcitect at work demonstrated a very simple app that used isolated storage and he said he couldn't tell it the location of the actual data storage. When he did it didn't put it in the path he specified.
Your thoughts.
|
|
|
|
|
You can access SQL Server through SOAP 1.1, i.e. a web service (whether it's a WCF Web Service or a good old fashioned WebMethod type).
This[^] should tell you where things are stored with Isolated Storage.
|
|
|
|
|
That's what my point is though. You have to hit a web service and cannot directly access the sql server with ADO.
Thanks for the link.
|
|
|
|
|
wolfbinary wrote: You have to hit a web service and cannot directly access the sql server with ADO.
True - but when you think about it, that's a logical thing to want to do. Typically, your database will be behind a Firewall in a DMZ. This means that you really should have something in the way so that the DB doesn't have to be exposed to the outside world.
|
|
|
|
|
Most of the web apps here aren't exposed to the outside world. They are for internal use only.
I do see your point about the DMZ, though.
|
|
|
|
|
Hello,
I have a silverlight application, and I want to open an aspx page inside the Silverlight and to interact between them.
Does anyone know if it is possible in Silverlight?
tnx
|
|
|
|
|
I have also the same issue with my Silverlight website with released version 2.
I have created a website with have some xaml pages, I want to show contents dynamically it might be aspx page or simple html page, contents of which can be loaded on the xaml page at runtime on a button click.
Thanks in advance
|
|
|
|
|
Hello,
I'm writing a windows application that uses the Amazon FPS web service. I would like to use WCF, though I don't have much experience with it yet. I thought that by adding a web reference to the service WSDL, that a proxy class would be created for me. The web reference was added, and I can browse the types defined in the WSDL in the object browser, but Visual Studio did not generate a proxy class.
What's the best way to proceed? Do I have to use svcutil to generate the proxy code?
Thanks!
Ian
|
|
|
|
|
You need to add a service reference.
Right click the project and [Add Service Reference]
Pop the service url into the address box and hit [Go]
Give it a name and click [OK]
...
|
|
|
|
|
Is this available in VS 2005? I couldn't find an options for adding a service reference. There were two options: Add Reference, and Add Web Reference.
Any ideas?
Thanks!
Ian
|
|
|
|