I'm looking to see if there is a way to change the color of a textblock in silverlight on mouse over. I have tried a trigger which I read now doesn't work. I would like to avoid having to do it in the codebehind if at all possible.
Hi,
I am creating a custom control Toolbox that is derived from ItemsControl. This toolbox is supposed to be filled with icons coming from the database. The definition looks like this:
public class Toolbox : ItemsControl
{
protected override DependencyObject GetContainerForItemOverride()
{
return new ToolboxItem();
}
protected override bool IsItemItsOwnContainerOverride(object item)
{
return (item is ToolboxItem);
}
}
Toolboxitem is derived from ContentControl.
public class ToolboxItem : ContentControl
{
static ToolboxItem()
{
FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolboxItem), new FrameworkPropertyMetadata(typeof(ToolboxItem)));
}
}
Since the number of icons stored in a database is not known I want to use the data template:
<DataTemplate x:Key="ToolBoxTemplate">
<StackPanel>
<Image Source="{Binding Path=url}" />
</StackPanel>
</DataTemplate>
Then I want the Toolbox to use the template.
<Toolbox x:Name="NewLibrary" ItemsSource="{Binding}" ItemTemplate="ToolBoxtemplate">
</Toolbox>
I'm using ADO.NET entity framework to connect to a database. The code behind:
SystemicsAnalystDBEntities db = new SystemicsAnalystDBEntities();
private void Window_Loaded(object sender, RoutedEventArgs e)
{
NewLibrary.ItemsSource = from c in db.Components select c;
}
However, there is a problem. When the code is executed, it displays the object from the database (as the ItemSource property is set to the object from the database) and not the images. It does not use the template. When I use the static images source it works in the right way
I found out that I need to override the PrepareContainerForItemOverride method.But I don't know how to add the template to it.
Thanks a lot for any comments.
Additional Information
Here is the ControlTemplate for ToolboxItem:
<ControlTemplate TargetType="{x:Type s:ToolboxItem}">
<Grid>
<Rectangle Name="Border"
StrokeThickness="1"
StrokeDashArray="2"
Fill="Transparent"
SnapsToDevicePixels="true" />
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="true">
<Setter TargetName="Border"
Property="Stroke"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
NSOutlineViewDelegate has outlineView:shouldEditTableColumn:item: which gets called before editing a cell. I need a similar method called after the user has finished editing a cell (in order to trigger some calculations). Where should I look for this event ?
Hi
I have the following piece of code and when I use Instruments/Object Allocations, it tells me that there is a leak there (which goes down to sqlite3MemMalloc). Is there something that I should release?
if (![managedObjectContext save:&error]) {
NSLog(@"Error while saving.");
}
The save works well and doesn't trigger an error.
I try to use the command so that i can schedule the deployment using cron trigger.
But however i been encountering this error.
java.io.IOException: Remote host closed connection during handshake
What could be the reason and how do i resolve it?
Is it something to do with the port i define?
I defined the port used in the admin-server system.
As for secure i set to true.
Hi
im using QTimeLine to run animation , now i like to trigger my custom function when the finished() signal is triggered
when the QTimeLinedo done its just ,but whit no lock i never getting this signal to fire
even that my : QTimeLine::State sts = timeLineFadeIn-state(); is QTimeLine::NotRunning
Any idea why ?
I have a file upload button on my MVC view. After the file is uploaded, my FileList partial view on the page should refresh.
I tried to upload with Ajax.BeginForm(), but have discovered that Ajax will not submit file data.
I've got the file upload working now by using the jQuery Form plugin, which lets you ajaxify the normal Html.BeginForm() submit method.
Is is still possible to trigger the partial page update using this method?
i have a screen with multiple little widgets (all with different divs around them). i have one form and when i post (using jquery) right now it updates the single form using ajax.
i want two other divs to refresh as well (that are outside the form). What is the best way to trigger a refresh of multiple different divs on a single jquery ajax post callback?
Hi
I have items in a table cell that gets toggled on and off.
An external button accepts a click and submits the selected cell values via ajax.
The problem is that I want to reset the toggle state for the selected cells.
I can easily unset the highlighting, but then need a double click to trigger the correct toggle.
Can the .toggle(odd, even) be reset or cycled via an external call?
Thanks
Hi,
I've been working with a Legacy application which interacts with a database through ADODB, and most of the changes to records follow a fairly straightforward pattern of:
Create a Recordset from a query
Make various change to the recordset
call .Update on the recordset.
What I'm wondering is, with ADODB recordsets, is there anyway to extract the 'changes'. The logic which changes the recordset is scattered about, and all I need is the changes, not how it was changed...
Any suggestions for tracking changes in a recordset (in code, a trigger on the DB or similar is no use here)
Thanks in advance
Hello all,
My question is quite simple,
I created a DIV, with a HyperLink control in it.
As following:
I created an 'onclick' event in jQuery for the DIV as well:
$('#divOne').click(function() {
alert('You clicked on the DIV element');
});
My goal is to trigger this event when the DIV area is clicked (working fine), BUT-
When the HyperLink is clicked, I need the page to redirect WITHOUT triggering the DIV 'onclick' event (can use JavaScript or jQuery as needed).
Thanks all!
Hi,
I would like to store some properties in the quartz datastore (jdbc) and then be able to find all triggers/jobs that match. E.g. store the user id related to a trigger and then query like user_id=555.
Previously, I used to query the database directly but this is naturally not a good way.
Anyone has another suggestion on how to accomplish this?
Thanks.
Ok, I've got a lightbox with a small form (2 fields) in it, inside an UpdatePanel, and I want to close this lightbox (must be done via javascript) when the 'Save' button is pressed.
However, there is a need to have a server-side CustomValidator on the page, and I only want to close the lightbox if this returns as valid.
Does anyone know a way to trigger javascript (or jQuery) code from a server-side validator?
Hi Folks,
I'd like to modify the sliders on-the-fly. I tried to do so by using
$("#slider").slider("option", "values", [50,80]);
This call will set the values, but the element will not update the slider positions.
Calling
$('#slider").trigger('change');
does not help either.
Is there another/better way to modify the value AND slider position ?
I have a Wicket panel that has AbstractAjaxTimeBehavior, that I'd like to unit test. How can I trigger a ajax event during the unit test that end up calling AbstractAjaxTimeBehavior's .onTimer(AjaxRequestTarget target) method?
behavior = new AbstractAjaxTimerBehavior(Duration.seconds(pollingPeriodInSeconds)) {
protected void onTimer(AjaxRequestTarget target) {
// how to unit test this?
}
}
add(behavior);
I've searched through related questions but can't find what I need.
I have a richtextbox control. I need to trigger an event when the vertical scrollbar reaches a certain position (say 90% down to the bottom). I've been playing around with the events for the rich textbox but have yet to find anything.
Any help would be greatly appreciated.
I need an event for my CF application, that would trigger after user has pressed an held his finger on the control for 2 seconds. What event can i use, since keyDown event is already used.
Hi all,
We often cache image and data to improve our iPhone app's performance. But what strategy do you use to manage the cache data, such as delete or update it?
When should we trigger to delete the cache data: when the iPhone apps starts, or quits, or in idle time?
I have a simple query over a table, which returns results like the following:
id id_type id_ref
2702 5 31
2702 16 14
2702 17 3
2702 40 1
2702 26 4
And I would like to merge the results into a single row, for instance:
id concatenation
2702 5,16,17,40,26:31,14,3,1,4
Is there any way to do this within a trigger?
NB: I know I can use a cursor, but I would really prefer not to unless there is no better way.
Hi,
is it possible to trigger Parent's page load event from a popup.When i use javascript function window.parent.document.form.submit,this creates a postback.I want a function which creates "reload" for page because some of my functions work in the "if not postback" statement.
Is there a way to prevent the zoom_change event from being triggered if it occurs due to fitBounds() ?
I am having an issue where I need to do a search on the server from client when there is a zoom change to map but every time I call fitBounds() it causes zoom_change to trigger which causes the client to do another search on the server. I am only interested in zoom_change done by users and not programmatically using fitBounds.
I want to write a custom ValidationAttribute that checks if the given value is unique or not.
The problem is that in the edit screen, it is not guaranteed that the user actually changed the value, resulting in a false error.
Is there a way to check in my attribute whether the value actually changed? Or can I trigger the attribute only when the value has changed?
I'm getting the feeling this requirement maybe just doesn't belong in an attribute?
I have a an ASP.NET MVC2 application, with Linq2SQL, that updates a database without using the UpdateModel. Is it still possible to trigger validation without using UpdateModel?
Hello!
I'm triying to add an easing function to this code. So I replaced "swing" with "easeInOutQuint" (for example) but it's not working. I'm using jquery 1.4.2 and jquery easing 1.3 downloaded from here (http://gsgd.co.uk/sandbox/jquery/easing/) Any help will be greatly appreciated! Thank you!
$(window).load(function() {
$('.trigger').click(function() {
$('.panel').animate({
width: ['toggle', 'swing'],
height: ['toggle', 'swing'],
opacity: 'toggle'
}, 190, 'linear', function() {
});
});