This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<IContentItem> FindContentItems(this IScreenObject screen, IEntityProperty viewModel) | |
{ | |
IPresentationScreenView screenView = VsExportProviderService | |
.GetServiceFromCache<IServiceProxy>().ScreenViewService.GetScreenView(screen) as IPresentationScreenView; | |
if (screenView == null) | |
{ | |
throw new InvalidOperationException(); | |
} | |
IContentItem currentView = screenView.ContentItemTree; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<IContentItemPresenter> GetAssociatedPresenters(this IContentItem contentItem) | |
{ | |
var internale = contentItem as IContentItemInternal; | |
if (internale == null) | |
return new List<IContentItemPresenter>(); | |
return internale.AssociatedPresenters; | |
} | |
public static void SetBackground(this IContentItemPresenter presenter, Color color) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//$(".msls-navmenu-button").hide(); | |
$(".msls-screen-buttons").empty(); | |
var hijackUI = function (contentItem) { | |
var user = contentItem.value; | |
//Create a link | |
var userViewer = $('<a id="userviewer" href="#" target="_self" >' + user.Name + '</a>'); | |
userViewer.appendTo($(".msls-screen-buttons")); | |
//Bind the click event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userViewer = $('<a id="userviewer" href="#" target="_self" >' + user.Name + '</a>'); | |
userViewer.appendTo($(".msls-screen-buttons")); | |
//interaction 1 | |
userViewer.on('click', function () { | |
myapp.showEditMyProfile(user); | |
}); | |
contentItem.dataBind("value.Name", function () { | |
//interaction 2 | |
$("#userviewer").text(contentItem.value.Name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Shoutout to MBoros on stackoverflow | |
public static class ExpressionCombiner { | |
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> exp, Expression<Func<T, bool>> newExp) | |
{ | |
// get the visitor | |
var visitor = new ParameterUpdateVisitor(newExp.Parameters.First(), exp.Parameters.First()); | |
// replace the parameter in the expression just created | |
newExp = visitor.Visit(newExp) as Expression<Func<T, bool>>; | |
// now you can and together the two expressions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myapp.menuHome.buttonResources_postRender = function (element, contentItem) { | |
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ResourcesLarge.png', { height:170, width:170}); | |
}; | |
myapp.menuHome.buttonDesigns_postRender = function (element, contentItem) { | |
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/DesignsLarge.png'); | |
}; | |
myapp.menuHome.buttonProjects_postRender = function (element, contentItem) { | |
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ProjectsLarge.png'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.LightSwitch.Client; | |
using Microsoft.LightSwitch.Details.Client; | |
using Microsoft.LightSwitch.Framework.Client; | |
using Microsoft.LightSwitch.Presentation; | |
using Microsoft.LightSwitch.Presentation.Extensions; | |
using Microsoft.LightSwitch.Presentation.Internal; | |
using Microsoft.LightSwitch.Sdk.Proxy; | |
using Microsoft.VisualStudio.ExtensibilityHosting; | |
using System; | |
using System.Collections.Generic; |
OlderNewer